Thursday, September 3, 2015

EcoResCategory Category Lookup in Form

// EcoResCategory Lookup in Form

Enable Purch/Sales Category in Customized Table:

TableOne(Customize Table)
1)      Create New Field – Data Type (Int64) ,Extends to Purch Category/Sales Category
2)      Create New Relation for New Field
2.1) Relation Table – EcoResCategory
2.2) Create Normal Relation
        Field – TableOne.fieldName == EcoResCategory.RecId
2.3) Relation Properties Changes to
      2.3.1) RelatedTableCardinality – ZeroOne
       2.3.2) Cardinality – Zero More
       2.3.3) RelationShip Type – Association
     à Form
3)      Form à datasource à tableàField(category Field)
3.1) Add New Method  -- resolveReference
 public Common resolveReference(FormReferenceControl _formReferenceControl)
{
    return EcoResCategory::resolveCategoryHierarchyRole(
        _formReferenceControl,
        EcoResCategoryNamedHierarchyRole::(CategoryType));
}

3.2) Add New Method  -- lookupReference

public Common lookupReference(FormReferenceControl _formReferenceControl)
{

        return EcoResCategory::lookupCategoryHierarchyRole(
            _formReferenceControl,
            EcoResCategoryNamedHierarchyRole:: ::(CategoryType));
}

3.3) Add New Method  -- Modified

public void modified()
{
    <CategoryEDT>               NAmeCategory;
    ItemFreeTxt                 name;
    LedgerDimensionAccount      ledgerDimension;

    name                     = salesQuotationLine.Name;

    NAmeCategory = salesQuotationLine.fieldName;
    salesQuotationTableForm.resetSalesQuotationLine(salesQuotationLine);
    salesQuotationLine. fieldName = NAmeCategory;
    salesQuotationLine_ds.changedInventoriedStatus();
 }



No comments:

Post a Comment

Copy Markup charges while posting purchase invoice using X++

 Copy Markup charges while posting purchase invoice using X++ Class: Important: Code logic is just for Reference.  New class => Duplicate...