web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :

Event handler for QueryExecuting to filter data

Sheikh Sohail Profile Picture Sheikh Sohail 6,125


You can use the below code sample to filter data in query execution event

1. Copy Form ->Data source  >Event > onQueryExecuting.
2. Paste this code in the New class.


[FormDataSourceEventHandler(formDataSourceStr(PayrollEmployerTaxRegion, PayrollEmployerTaxRegion), FormDataSourceEventType::QueryExecuting)]
    public static void PayrollEmployerTaxRegion_OnQueryExecuting(FormDataSource sender, FormDataSourceEventArgs e)
    {
 
        sender.query().dataSourceName(sender.name()).addRange(fieldnum(PayrollEmployerTaxRegion,     CountryRegionId)).value(queryValue(LogisticsAddressCountryRegion::findByISOCode(SysCountryRegionCode::countryInfo(curext())).CountryRegionId));
     
    }

This was originally posted here.

Comments

*This post is locked for comments