Friday, March 15, 2019

How to perform a Lookup for a particular FinancialDimension using X++?

{
    SysTableLookup                      sysTableLookup;
    Query                               query;
    QueryBuildDataSource                qbdsDimensionFinancialTag;
    QueryBuildRange                     qbrFinancialTagCategory;

    #define.MyCustomFinancialDimension('Divisions')

    query = new Query();
    qbdsDimensionFinancialTag = query.addDataSource(tableNum(DimensionFinancialTag));
    qbrFinancialTagCategory = qbdsDimensionFinancialTag.addRange(fieldNum(DimensionFinancialTag, FinancialTagCategory));
    qbrFinancialTagCategory.value(strFmt('%1', DimensionAttribute::findByName(#MyCustomFinancialDimension, false).financialTagCategory()));

    sysTableLookup = sysTableLookup::newParameters(tableNum(DimensionFinancialTag), this);
    sysTableLookup.addLookupfield(fieldNum(DimensionFinancialTag, Value), true);
    sysTableLookup.addLookupfield(fieldNum(DimensionFinancialTag, Description));
    sysTableLookup.addSelectionField(fieldNum(DimensionFinancialTag, FinancialTagCategory));
    sysTableLookup.parmQuery(query);

    sysTableLookup.performFormLookup();
}

3 comments:

  1. Thanks for sharing this informative content , Great work
    Leanpitch provides online training in Enterprise agile coaching during this lockdown period everyone can use it wisely.
    Enterprise agile coaching

    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.

    Scrum master certification

    ReplyDelete
  3. I like this web blog so much, saved to my bookmarks . click to read more

    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...