Simple Look Up D365FO - AX-2012


Simple Look Up D365FO - AX-2012


Simple Look Up
Today we learn Simple Look Up in just 4 Step
Step: 1
Create a form Then add StringEdit Control in Design and override the lookup method.




Step: 2
Copy Paste this Code in the lookup method




Step :3
Create a AOT Query . In this tutorial my query name is  LookUpFormQuery 




Step :4
Compile Complete Project and Run the form




Support Faryal's Cusine


Event handler for QueryExecuting to filter data

Event handler for QueryExecuting to filter data


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));

    }

Support Faryal's Cusine


Virtual Fields Vs Computed Fields

  Virtual Field: A virtual field in D365FO is a field that doesn't have a direct representation in the database. It's a field that y...