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

Copy Markup charges while posting purchase invoice using X++

 Copy Markup charges while posting purchase invoice using X++ Class: Important: Code logic is just for Reference.  New class => Duplicate...