Options

Publish a webservice that returns multiple records

livingdolllivingdoll Member Posts: 45
edited 2011-09-20 in NAV Three Tier
Hi folks,

I've started to fumble around with webservices in NAV 2009 R2. I want to publish a webservice that can return the actual stock level of an item (per location). The webservice gives Item No. and Unit Of Measure as input to the NAV function. Then NAV has to return one or more lines with Item No., Unit of Measure, Location Code and the actual stock level.

How can I manage this? I know how to publish a page or a function in a codeunit, my problem is that I can't figure out how to return data of multiple records!

Thx

Josh

Comments

  • Options
    kinekine Member Posts: 12,562
    You can return the value into bigtext as xml or you can use XMLPort as a parameter of the function of type.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    matttraxmatttrax Member Posts: 2,309
    I think you would have to pass your BigText by reference instead of by value (the checkbox in the left hand column when defining parameters). I don't think functions can return a BigText value.
  • Options
    livingdolllivingdoll Member Posts: 45
    Thx. I will investigate it.
  • Options
    companycompany Member Posts: 89
    hi,

    May be you can use array variables and pass them by reference.

    Hope this works

    Thanks
  • Options
    kinekine Member Posts: 12,562
    company wrote:
    hi,

    May be you can use array variables and pass them by reference.

    Hope this works

    Thanks
    Even when possible, i will never use this solution. Array is limited, you never knows count of records. ;-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.