Hello,
I have a page, which displays the Lot Numbers (as a list) to an article. This page gets the data via a function in the page, because the page has set the property SourceTableTemporary to Yes. The SourceTable is Lot Number by Bin Buffer.
The OnOpenPage trigger calls the local function FillTable, which inserts the data.
The article number is transferred with another function (ParameterSet) and this is then used in the FillTable.
This works inside Navision perfectly!
Now I want to use this page as a web service. How can I transfer the article number so that the Lot Numbers list is created only for this article number.
Thanks,
stony
0
Answers
Just an idea, you add this "article number" as a field into your source table.
Before you get data from the web service, you can set filter to "article number", and inside the page, you can Getfilter of "article number", then clear filter, insert data.
Sorry, I have not try this, but could you try in the OnOpenPage trigger?
The solution proposed by @allenyyzhou have all chances to work. First, try to make your "Article number" a flowfilter in your table. If it still doesn't work try moving the code and add some code in OnFind. Perhaps something like this
(Note I did not try this myself either )
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Couldn’t find a trigger that worked.
I solved it with the real table and som flow fields for the needed data.
So maybe we are stuck on soap and xml/codeunit for this scenario???
Or if you can compose a query instead.
Can confirm the suggested solution of @allenyyzhou works for NAV365 / 14.
If you create a page based on a temporary table, publish it as a webservice and require to fill it with a custom function you can pass variables to OnOpenPage as a filter in the ODATA query f.e.
http://nav365:7048/NAV/ODataV4/Company('CRONUS')/CustomCustomerPage?$filter=No eq '1005'
You can use GetFilter("No.") in the OnOpenPage to retrieve the filter (1005) value. Be sure to call Reset() as suggested to clear this and any other filters if you don't actually want them applied.