Monday, July 1, 2019

Filter Data on FORM event Handler in D365 FO

Filter Data on FORM event Handler in D365 FO

FormDS EVent Type: QueryExecuting

Create new Class and Paste Event Handler code

[FormDataSourceEventHandler(formDataSourceStr(<FormName>, <FormDSName>), FormDataSourceEventType::QueryExecuting)]
public static void <FormDSname_Default>_OnQueryExecuting(FormDataSource sender, FormDataSourceEventArgs e)
{
   sender.query().dataSourceName(sender.name()).addRange(fieldnum(<Table>,<FieldName>)).value(queryValue(<Value>));
}

No comments:

Post a Comment

Convert Call stack to readable format in D365FO X++

//Input --container _xppCallStack = xSession::xppCallStack();  Public static str POL_formatXppCallStack(container _xppCallStack, int _skipFr...