My custom display method in the extension doesn't work in addLookupMethod.
My custom display method in the extension doesn't work in addLookupMethod.
Good reference for lookup in forms.
[quote user="Moeen Ahmed Sultan"]Hi,
To create lookup, please follow one of the following article:
1) http://msdynamics.nevoitech.com/microsoft/how-to-create-lookup-in-form-data-source-field-in-d365fo/ (Recommended)
2) http://msdynamics.nevoitech.com/microsoft/how-to-create-lookup-in-d365fo-using-x/
[/quote]Changed my approach and used the BudgetCycle method editCycleStartDate and editCycleEndDate
private void calendarYearLookup(FormStringControl _lookup)
{
Query query = new Query();
QueryBuildDataSource qbds;
SysTableLookup sysTableLookup;
if(_lookup != null)
{
sysTableLookup = SysTableLookup::newParameters(tableNum(BudgetCycle), _lookup);
qbds = query.addDataSource(tableNum(BudgetCycle));
qbds.addSortField(FieldNum(BudgetCycle, Name),SortOrder::Ascending);
qbds.fields().addField(fieldNum(BudgetCycle, StartFiscalCalendarPeriod));
qbds.fields().addField(fieldNum(BudgetCycle, EndFiscalCalendarPeriod));
sysTableLookup.addLookupField(fieldNum(BudgetCycle, Name), true);
sysTableLookup.addLookupMethod(tableMethodStr(BudgetCycle, editCycleStartDate));
sysTableLookup.addLookupMethod(tableMethodStr(BudgetCycle, editCycleEndDate));
sysTableLookup.parmUseLookupValue(false);
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}
Thanks!
Hi,
There are links to GitHub repository. And please verify the answer.
Regards,
Moeen Ahmed Sultan
Hello,
Code looks fine. It should be working fine.
Could you paste the full code from lookup method.
Thanks and regards,
Bharath
Hi,
To create lookup, please follow one of the following article:
1) http://msdynamics.nevoitech.com/microsoft/how-to-create-lookup-in-form-data-source-field-in-d365fo/ (Recommended)
2) http://msdynamics.nevoitech.com/microsoft/how-to-create-lookup-in-d365fo-using-x/
Hi Jerrold,
According to your description, it is similar to this thread, you can understand the context.
[View:https://community.dynamics.com/365/financeandoperations/f/dynamics-365-for-finance-and-operations-forum/287667/addlookupmethod-from-method-in-extension-table-class:750:50]
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,263 Super User 2024 Season 2
Martin Dráb 228,112 Most Valuable Professional
nmaenpaa 101,148