Tuesday, May 21, 2019

Query to get the Lookup on Financial dimension using X++

    Query                   query = new Query();
    QueryBuildDataSource    qbds,qbds1;
    SysTableLookup          sysTableLookup;
    #define.DimensionName("ProfitCenter")
    DimensionAttribute      dimAttr;

    sysTableLookup  = sysTableLookup::newParameters(tableNum(DimensionFinancialTag), _formStringControl);
    dimAttr         = DimensionAttribute::findByName("Profitcenter"); //Financial Dimension Name
    sysTableLookup.addLookupField(fieldnum(DimensionFinancialTag, Value));
    sysTableLookup.addLookupField(fieldnum(DimensionFinancialTag, Description));

    qbds = query.addDataSource(tableNum(DimensionFinancialTag));
    qbds1 = qbds.addDataSource(tableNum(DimensionAttributeDirCategory));
         qbds1.addLink(fieldNum(DimensionFinancialTag,FinancialTagCategory),fieldnum(DimensionAttributeDirCategory,RecId));
    qbds1.addRange(fieldNum(DimensionAttributeDirCategory, DimensionAttribute)).value(queryvalue(dimAttr.recid));

    sysTableLookup.parmQuery(query);
    sysTableLookup.parmUseLookupValue(false);
    sysTableLookup.performFormLookup();

2 comments:

  1. Thanks for sharing this informative content , Great work
    Leanpitch provides online training and certification in Scrum master during this lockdown period everyone can use it wisely.
    Scrum master certification

    ReplyDelete
  2. Thanks for sharing this.,
    Leanpitch provides online training in Scrum Master during this lockdown period everyone can use it wisely.
    Join Leanpitch 2 Days CSM Certification Workshop in different cities.


    CSM online

    ReplyDelete

How to enable the dimension fields based on the Item selected on the form.

[Form] public class KMTShipFromWarehouses extends FormRun {     InventDimCtrl_Frm_EditDimensions        inventDimFormSetup;     /// &l...