Hi guys
I need to make a DropDown, where lookup is data from a web services, called on lookup.
Wondering the best way to do this.
My idea is to fill a temp table in OnLookup trigger, but this will force me to open a page, to pick the value.
But i need to use DropDown, and also search (filter as you type) and change column key.
Syncing the values to real tables doesn’t work, as data is different based on a previous DropDown.
So it’s a DropDown from WS, then another DropDown from WS that’s based on the one before, and then yet another.
So the dataset can’t be saved to NAV ahead of time, as the business logic from the foreign system can’t be replicated.
Any ideas ?
Need to work on web client and BC(AL) so no .NET
Follow me on my blog
juhl.blog0
Answers
The lookup page could be defined as SourceTableTemporary=Yes so any web service call result stored in there would not start a transaction.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Of course, I didn't think of creating a page for the buffer table. That would work.
Only downside is validation, as you cant test for tablerelation, so the user can input anything he wants. But again that could be tested against the webservice.
Thanks.
That variable is used in OpOpenPage, to call the right web service.
Any idea Slawek?
In scenarion like calling PAGE.RUNMODAL(someid, somerec), or CODEUNIT.RUN(someid, somerec) where someid comes form some setup field, and still having to pass some parameters to called object I'd be coding this as in the mockup code below:
Then all objects which are supposed to be called that way would have a little code in OnOpenPage, or in OnRun, to retrieve requested parameter from the filter passed on rec, and the clear the filter (maybe leaving whatever is on left side of the | char as the "real" filter.
In case like this one where OnLookup trigger can't be really touched I'd be setting up conditional/filtered relation, where the condition or filter would include required parameter(s):
Then in OnOpenPage I'd try retrieve my parameters passed in filters.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
I thought of filters too, but could not get it to work. But I get your solution.
Thanks :-)