How can pass Record Variable using Webservices ?

SHIV_DYNSHIV_DYN Member Posts: 30
edited 2010-03-19 in NAV Three Tier
Hi everyone,
Is it possible to pass a Record Variable using Webservices(Ex: From Web page to Navision) ?
Could anyone help me out, by providing the related documents or website URL’s.
Thanks & Regards,
Shiv

Comments

  • eYeeYe Member Posts: 168
    Hi

    I also tried this. The web reference gives you an error that the parameter is incorrect.

    So the next best thing is to pass the primary key values and do a GET in NAV.
    If you modified the record, be sure to do .UPDATE(..) before calling your function in NAV.

    Hope this helps.

    Regards,
    Ewald
    Kind Regards,
    Ewald Venter
  • SHIV_DYNSHIV_DYN Member Posts: 30
    Hi Ewald,
    Thanks for your replay. I am doing the same thing (passing the primary key values). But here my doubt is why can’t we send record variable as a parameter?
    Thanks & Regards,
    Shiv
  • eYeeYe Member Posts: 168
    As I understand, the issue is with returning complex data types - which is not even possible within NAV. Why you can't pass it as a parameter by reference to a function from the web side escapes me.

    There are however ways to get around it (although I did not have time to try it out as of yet) as described in Implementing Microsoft Dynamics NAV 2009 by David Roys , Vjekoslav Babić
    Kind Regards,
    Ewald Venter
  • ara3nara3n Member Posts: 9,256
    you can pass by value record variable, if you publish the codeunit as same name as pages.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • eYeeYe Member Posts: 168
    I just tried it, got the following error:

    pRecCustomer of the type INavRecordHandle in method TestPassRec in service Customer is invalid!
    Kind Regards,
    Ewald Venter
  • ara3nara3n Member Posts: 9,256
    The Page and the codeunit have the same table and not passed by ref?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.