SBX - Search With Button

SBX - Forum Post Title

Lookup on form datasource field

Dynamics 365 for Finance and Operations Forum

Krushna asked a question on 14 Jun 2019 2:18 PM

Question Status

Suggested Answer

Lookup does not work on form data source field via chain of command. Though lookup works via event handler, I seek your input on achieving this by chain of command.

VERSION INFORMATION
Installed product version : Microsoft Dynamics 365 for Finance and Operations (10)
Installed platform version : Update26

[ExtensionOf(formDataFieldStr(InventNonConformanceTableCreate,InventNonConformanceTable,MyStingControl))]
final class FARInventNonConfTableCreateFrmCtrl_Extension
{
public void lookup(FormControl _control,str _filter)
{
next lookup(_control,_filter);

Query query = new Query();
query.addDataSource(tableNum(DirOrganization));

SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(DirOrganization),_control);

sysTableLookup.addLookupfield(fieldNum(DirOrganization,PartyNumber));
sysTableLookup.addLookupfield(fieldNum(DirOrganization,Name));

sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}

}

Reply
Blue Wang responded on 19 Jun 2019 12:58 AM
My Badges

Hi Krushna,

Has your problem been solved?
Still using event hander.

Reply
Moeen Ahmed Sultan responded on 19 Jun 2019 6:02 AM
My Badges
Suggested Answer

Hi,

You are using the form control's event handler. Try this code: msdynamics.nevoitech.com/.../how-to-create-lookup-in-form-data-source-field-in-d365fo

Reply
Moeen Ahmed Sultan responded on 19 Jun 2019 6:02 AM
My Badges
Suggested Answer

Hi,

You are using the form control's event handler. Try this code: msdynamics.nevoitech.com/.../how-to-create-lookup-in-form-data-source-field-in-d365fo

Reply

SBX - Two Col Forum

SBX - Migrated JS