Skip to main content

Lookup for Form control in D365

In some cases, we do not have access to lookup control of a field in Form datasource due to restrictions in override method or Autodeclaration method on the form string control.
In my case, the field which i wanted a lookup was to be added to a field group. The AutoDeclaration property was not editable and set to No. Hence i could not use the lookup.

FormControl_lookup eventhandler.PNG
I created a class which has a lookup method like the one we had in previous versions of AX. I have a constructor method along with it in the class.
SysTableLookUp method.PNG
Now i am Initializing the lookup on the control during run time.
Get the control of the formDataObject and use registerOverrideMethod to add the lookup.
AVACustParameters_Extension_lookup method.PNG
Cost center lookup.PNG

Comments