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
Krushna responded on 24 Jun 2019 9:40 AM

Hello Blue Wang,

NO.

Yes, did it through event handler.

Krushna.

Reply
Krushna responded on 24 Jun 2019 9:45 AM

Hello,

I followed below blog post and achieved it via event handler but I am struggling it through chain of command on lookup method of data source field.

ievgensaxblog.wordpress.com/.../d365foe-how-to-override-form-data-source-field-lookup-method

Thanks,

Krushna

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