Return Multi-Array from Codeunit webservice

doodoo Member Posts: 12
edited 2010-05-14 in NAV Three Tier
Hi all,

I've created a codeunit, published as webservice with a function that returns an array in Navision. On Return value Dimension property set to "100;2".

My function :
getJobList(pResourceCode : Text[50]) lJobList : ARRAY [100,2] OF Text[50]
CLEAR(lJobList);
i := 0;

IF lResource.GET(pResourceCode) THEN
BEGIN

  IF lResource.CheckJobFilter(lJobTmp) THEN
  BEGIN

    IF lJobTmp.FINDFIRST() THEN
    REPEAT

      i += 1;

      lJobList[i][1] := lJobTmp."No.";
      lJobList[i][1] := lJobTmp.Description;

    UNTIL lJobTmp.NEXT() = 0;
    
  END;

END;

When I want to call this webservice function from my aspx.cs webapplication I receive this error :

Error 1 Cannot implicitly convert type 'string[]' to 'string[*,*]' C:\WORK\DEV\TOOLS\WebApplication1\WebApplication1\Default.aspx.cs 32 33 WebApplication1


Here is part of my C# code :
// Create instance of NavFunctions and set credentials.
NavFunctions NavFunc = new NavFunctions();
NavFunc.UseDefaultCredentials = false;
NavFunc.Credentials = new NetworkCredential(UserName.ToString(), UserPwd.ToString(), UserDom.ToString());

// Get Resource Code
string ResourceCode = NavFunc.GetResourceCode(UserName.ToString(), UserDom.ToString());

//Create JobList Array list
string[,] JobList = NavFunc.GetJobList(ResourceCode.ToString());

It seems that my multi-array return value is interprated as simple array. How can we do to return multi-array from nav webservice codeunit ?

Thanks for your precious help :idea:

Comments

Sign In or Register to comment.