[solved]WEB API and ODATA and NAV 2013/R2 and NAV2016

massimopasqualimassimopasquali Member Posts: 82
edited 2016-11-08 in NAV Three Tier
Hello,

I'm developing a WEB API for sincronize an APP with NAV2013/R2 and NAV2016; I chose the protocol ODATA when I startd this project published a page 18 Customer like ODATA Service.

My question are :smile:

1) When I'm going to publisher a new record or I'm going to update a record using ODATA protocol by web service, the evaluation control, the trigger before insert/update value, etc will be it execute?

2) Have you never used ODATA to exchange data with an APP or other system device? Have you found some limit?

3) Is a possible to call a codeunit using ODATA protocol, passing IT a JSON like BigText?

thanks in advance

Comments

  • Wisa123Wisa123 Member Posts: 308
    1.) Yes, triggers should execute.
    2.) Yes i have, not really a limit, but make sure to let NAV do the filtering of records before you get the data, or you'll have performance issues.
    3.) No it is not, CodeUnits only respond to SOAP to my knowledge.
    Austrian NAV/BC Dev
  • gpeturssongpetursson Member Posts: 3
    You can not use ODATA to insert or change data in NAV asfaik.
  • massimopasqualimassimopasquali Member Posts: 82
    Thanks Wisa123, gptursson are you sure? becouse I found more tutor where using odata to insert data. Looks the video

    https://www.youtube.com/watch?v=1yWnUuQ7lB0
  • archer89archer89 Member Posts: 337
    edited 2016-08-10
    odata is readonly in nav 2013,
    odata is useable read/write with nav 2013r2 and newer

    follow https://msdn.microsoft.com/en-us/library/hh166950(v=nav.71).aspx

    run insert/update triggers: if you publish e.g. a page like sales order, item card, customer card, then the page (and in second leve the table triggers) are run. in general it depends on the nav code behind. you can also develope your own codeunit and publish it as nav wev service. then only your code is run. if you want the insert/delete/modify table triggers run, then always use it with parameter value true, e.g. insert(true). that runs the according trigger.

    odata and soap are widely used in external apps nowadays.

    now problem to delliver big texts in parameters of a odata web service, simpy use a text variable with no size in the function. for complex parameter types use xmlports.
    best regards
    Franz Kalchmair, MVP
    Alias: Jonathan Archer

    please like / agree / verify my answer, if it was helpful for you. thx.
    Blog: http://moxie4nav.wordpress.com/
  • massimopasqualimassimopasquali Member Posts: 82
    thanks
Sign In or Register to comment.