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();
 }



Upload data from Excel in D365FO X++

 Action Menu Item: SAN_UploadExcelData Object type: Class Object: <Controller class name> Label: <> Class: Controller class clas...