Lookup in form level

/// <summary>



/// Lookup for admin to select data projects of type import in DMF parameters form for users to use during quote import

/// </summary>

/// <param name="sender"></param>

/// <param name="e"></param>

[FormControlEventHandler(formControlStr(DMFParameters, KGSPP_DMFDefinitionGroup), FormControlEventType::Lookup)]

public static void KGSPP_DMFDefinitionGroup_OnLookup(FormControl sender, FormControlEventArgs e)



{

SysTableLookup tableLookup;

Query query = new Query();

tableLookup = SysTableLookup::newParameters(tableNum(DMFDefinitionGroup), sender);

tableLookup.addLookupfield(fieldNum(DMFDefinitionGroup, DefinitionGroupName), true);

tableLookup.addLookupfield(fieldNum(DMFDefinitionGroup, OperationType));

QueryBuildDataSource qbds = query.addDataSource(tableNum(DMFDefinitionGroup));

qbds.addRange(fieldNum(DMFDefinitionGroup, OperationType)).value(queryValue(DMFOperationType::Import));



tableLookup.parmQuery(query);

tableLookup.performFormLookup();

}


Comments

Popular posts from this blog

Data entites method calling sequence in D365FO

How to Extend Sales Order Update Functionality to Custom Fields in D365 Finance and Operations

To generate dimension and find the account value - KGSPMIDimensionUtility