Example of lookupReference

public Common lookupReference(FormReferenceControl _formReferenceControl)
{
    SysReferenceTableLookup     sysRefTableLookup;
    Query                       lookupQuery = new Query();
    QueryBuildDataSource        lookupQueryDataSource;
 
    sysRefTableLookup = SysReferenceTableLookup::newParameters(tableNum(RetailChannelProfile), _formReferenceControl);
 
    sysRefTableLookup.addLookupfield(fieldNum(RetailChannelProfile, Name));
    sysRefTableLookup.addLookupfield(fieldNum(RetailChannelProfile, ChannelProfileType));
 
    lookupQueryDataSource = lookupQuery.addDataSource(tableNum(RetailChannelProfile));
 
    lookupQueryDataSource.addRange(fieldNum(RetailChannelProfile, ChannelProfileType)).value(queryValue(RetailChannelProfileType::VKCallCenter));
 
    sysRefTableLookup.parmQuery(lookupQuery);
 
    return sysRefTableLookup.performFormLookup();
}

 

Search

About

DaxOnline.org is free platform that allows you to quickly store and reuse snippets, notes, articles related to Dynamics AX.

Authors are allowed to set their own AdSense units and "buy me a coffee" link.
Join us.

Blog Tags