Webservice with and temp Table

stonystony Member Posts: 122
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

Best Answer

Answers

  • allenyyzhouallenyyzhou Member Posts: 142
    Hi

    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.
  • stonystony Member Posts: 122
    Where in the page I can read this filter and delete it again.
  • allenyyzhouallenyyzhou Member Posts: 142
    Hi

    Sorry, I have not try this, but could you try in the OnOpenPage trigger?
  • stonystony Member Posts: 122
    Unfortunately does not work
  • JuhlJuhl Member Posts: 724
    I tried making this work the other day, but without luck. (Odata)
    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.
    Follow me on my blog juhl.blog
  • Paul365Paul365 Member Posts: 3
    Late to the party but perhaps helpful to the weary internet traveller:

    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.
        trigger OnOpenPage()
        var
            Customer: record Customer;
        begin
            if (Customer.GET(GetFilter("No."))) then begin //Retrieve filter value
                Reset(); //Clear filters
                SetPageData(Customer."No."); //Call to the custom function to fill the temp table
            end;
        end;
    
Sign In or Register to comment.