Tuesday 21 August 2018

Dimensions lookup based on dimension attribute name in D365

On Lookup Method


[FormControlEventHandler(formControlStr(EcoResCategory, EcoResCategory_DOMFinancialProductGroup), FormControlEventType::Lookup)]
    public static void EcoResCategory_DOMFinancialProductGroup_OnLookup(FormControl sender, FormControlEventArgs e)
    {
        EcoResProductParameters     ecoResProductParameters;

        select USMFFinancialProductGroup from ecoResProductParameters;

        DimensionValueLookupHelper::lookupDimensionValues(DimensionAttribute::findByName(ecoResProductParameters.USMFFinancialProductGroup), sender, curExt());

//USMFFinancialProductGroup can be BusinesUnit, Department, CostCenter etc
    }


Reference

https://community.dynamics.com/ax/b/dynamicsax7knowledge/archive/2016/10/17/dimension-lookup-in-ax7

1 comment: