I want to use the custom values for lookup, not want to make the table. How can I achieve this through Coding? I have tried the following code but it's quite old and not working in D365. Actually, there is no method such as SysLookup::lookupList().
public void lookup()
{
Counter yearCount;
List valueList = new List(Types::String);
for (yearCount = 0; yearCount < 5; yearCount++)
{
valueList.addEnd(strFmt("Year %1", year(SystemDateGet()) - yearCount));
}
SysLookup::lookupList(this, valueList, "List of years");
}
*This post is locked for comments
Hi Bilal,
Override your control's lookup().
Hi Blue,
where I will place this piece of code? because i tried an example like that in the event handler it didn't work.
[quote user="Blue Wang"]Hi Bilal,
Are you looking for a non-database lookup?
You can check Global :: Picklist () if it's meet your needs.
A simple example:
Thanks, Sergei
Hi Bilal,
Are you looking for a non-database lookup?
You can check Global :: Picklist () if it's meet your needs.
A simple example:
Map lookupmap = new Map(Types::Integer, Types::String); lookupmap.insert(1,"First"); lookupmap.insert(2,"Second"); lookupmap.insert(3,"Third"); Global::picklist(lookupmap);
Hi,
Check class SysPickList and especially how it's used in DirPartyLookupFormEventHandler_CopyCustVend.CopyCustFrom_OnLookup method.
Hi Bilal,
Have you considered creating a temporary table; then fill this table with the values dynamically and then use it for the lookup?
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,902 Super User 2024 Season 2
Martin Dráb 229,297 Most Valuable Professional
nmaenpaa 101,156