Function to return multiple values

Hey,

i'm integrating navision with a website, and i need to print out some customer data. Is it possible in navision to return multiple values?. i'm thinking like:

Function getCust(customerNo)
multiple return:
name,address, etc etc.

 

is that possible to do in NAV?

 

my integration is through web services.

 

thanks. 

  • Hello, you should do something like this:

    Create multiple global variables:
    Name
    Adress
    Etc

    Define a function:
    getCust()

    In the function getCust write the following

    Name:=Value
    Address:=Value
    etc:=Value

    But still, why not simply filter the table when calling from Webservice? I think it's simpler.

    best regards,
  • In reply to THomas Barbut:

    Hey Thomas. The function will be implemented using codeunits. Therefore, i'm not sure how to do the filter part.
    Some of the fields have different data types, and that's a problem too.
  • In reply to lynix_mo:

    Hello,

    It's not possible to return multiple values in a function.

    Another way would be to add some kind of separator:

    Write a function like this.

    Function getCust(customerNo)

     return X :

    X:= name + "|" + address + "|" + etc

     

    After that you would have to separate it in your application.

    Hope this one helps you out.

     

    best regards,

Related