Options

Distribute table with codeunit

Hi,

I have a codeunit webservice for exporting products. Instead of exporting the entire item table in one batch, I'd like to split it up into smaller batches, and then have the consumer party request the web service continuously. I'm using a custom table to keep track of, how many records have been exported, so I would like that table to be distributed with the code unit, but I haven't found any way of doing that.

Perhaps my approach with the table is not the best? Any advice would be much appreciated.

BR.
Lars

Answers

  • Options
    frankmortensenfrankmortensen Member Posts: 42
    I would leave it up to the consumer of the webservice to keep track of how many records was exported.
    If you are exporting the table in "primary key" order, then add a parameter in your webservice, allowing the consumer of the webservice to send info about the last received products primary key value. Use that info to find the next record(s), and send the record(s).
  • Options
    larshslarshs Member Posts: 17
    Hi,

    Sorry, I've had problems logging in.

    That's a good suggestion, but that's not an option in this scenario, as the consumer system is not able to pass parameters in the request to the webservice. That's why I need to keep track of the progress in NAV.

    BR.
    Lars
  • Options
    JuhlJuhl Member Posts: 724
    Do they support pagination?
    Then use a page web service.
    Follow me on my blog juhl.blog
  • Options
    larshslarshs Member Posts: 17
    No, they are only able to pass requests untill a certain condition is met. So NAV has to keep track of, how many items have been exported.
  • Options
    JuhlJuhl Member Posts: 724
    Find another solution.
    Do they have an api you could call instead?
    Follow me on my blog juhl.blog
  • Options
    larshslarshs Member Posts: 17
    edited 2018-10-01
    Is it possible to distribute a table alongside with a code unit? It's not an architectual question because the architecture is provided by the consumer.

    BR.
    Lars
Sign In or Register to comment.