Options

Issue in INSERT Function - WEB Services (Sales Line)

Ravi_ThakkarRavi_Thakkar Member Posts: 392
edited 2009-06-16 in NAV Three Tier
Hello All Experts,

Currently I am working with the Sales Order Sub Form Page Web-Service in Visual Studio .NET (C#).
I am trying to insert a Sales Line in Perticular Sales Order by using the Insert Function of the Same Web Service.
I wrote as follows,
SalesOrderSubForm_Service Ss2 = new SalesOrderSubForm_Service();
            SalesOrderSubForm S2 = new SalesOrderSubForm();
            Ss2.Url = "http://spvm:7047/DynamicsNAV/WS/CRONUS_International_Ltd/Page/SalesOrderSubForm";
            Ss2.UseDefaultCredentials = true;
            S2.Document_No = "1020";
            S2.Line_No = 10000;
            Ss2.Create(ref S2);
But, through NAV code execution, I found that, it is assigning the Last record of SalesHeader table to SalesHeader record variable and since it is Released Status order, it is showing me the error "Status must be Open in Sales Header".

That means, I am unable to locate the Selected Order using this Web-Sevice.
So, is there any sollution?
Ravi_Thakkar
Ahmedabad, Gujarat, India
E Mail : ravi.thakkar@hotmail.com

Answers

  • Options
    freddy.dkfreddy.dk Member, Microsoft Employee Posts: 360
    You should go through the sales order and not directly to the sales order line.
    Freddy Kristiansen
    Group Program Manager, Client
    Microsoft Dynamics NAV
    http://blogs.msdn.com/freddyk

    The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
  • Options
    Ravi_ThakkarRavi_Thakkar Member Posts: 392
    Thanks for reply Freddy.
    I tried to use as you suggested.
    But, I dint find any methods for the Sales Order Line insertion in Sales Order web service.
    I found Sales Order Line object, but no methods of it. I can use it only to access the fields of it.

    Can you suggest me some example code?
    Thanks in Adv.
    Ravi_Thakkar
    Ahmedabad, Gujarat, India
    E Mail : ravi.thakkar@hotmail.com
  • Options
    freddy.dkfreddy.dk Member, Microsoft Employee Posts: 360
    On the Sales Order there is an array of order lines - you insert or delete in this array and call update on the order (just as you would do in the UI).
    Freddy Kristiansen
    Group Program Manager, Client
    Microsoft Dynamics NAV
    http://blogs.msdn.com/freddyk

    The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
  • Options
    swapnil1985swapnil1985 Member Posts: 12
    Hi Freddy and Ravi,

    Thanks for the discussion on this topic...

    I got your point freddy, i tried also to insert a new line but was not successful..
    Can you please point out the exact method.

    Thanks in Adv.
  • Options
    Ravi_ThakkarRavi_Thakkar Member Posts: 392
    Hello Freddy,

    Thanks for your reply and suggestion.
    It really insertion of new line worked nicely. Deletion is under testing.
    =D> =D> =D>

    Thanks again.
    Ravi_Thakkar
    Ahmedabad, Gujarat, India
    E Mail : ravi.thakkar@hotmail.com
  • Options
    Ravi_ThakkarRavi_Thakkar Member Posts: 392
    Hello Freddy,

    I tried for the DELETION of Sales Line by using array and then update function of Sales Order web service. But, unable to do the same.
    Can you please suggest in some detail?

    Since this post is related to INSERTION issues, provide me the suggestion on following link for DELETION issues :
    http://mibuso.com/forum/viewtopic.php?f=32&t=34250&sid=cab5d23f62f81fe3af443c09e0132235

    Thanks in Adv.
    Ravi_Thakkar
    Ahmedabad, Gujarat, India
    E Mail : ravi.thakkar@hotmail.com
  • Options
    freddy.dkfreddy.dk Member, Microsoft Employee Posts: 360
    I thought this topic was too large to describe here - AND the fact that SP1 changes some things - I have created a description on how to work with Sales Orders through page based web services on my blog:

    http://blogs.msdn.com/freddyk/archive/2 ... d-rtm.aspx

    Hope that helps
    Freddy Kristiansen
    Group Program Manager, Client
    Microsoft Dynamics NAV
    http://blogs.msdn.com/freddyk

    The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
  • Options
    Ravi_ThakkarRavi_Thakkar Member Posts: 392
    Thanks Freedy.

    I will go through your blog on specified link.
    Thanks for help.
    Ravi_Thakkar
    Ahmedabad, Gujarat, India
    E Mail : ravi.thakkar@hotmail.com
  • Options
    Ravi_ThakkarRavi_Thakkar Member Posts: 392
    Thanks all.
    Problem solved.
    Ravi_Thakkar
    Ahmedabad, Gujarat, India
    E Mail : ravi.thakkar@hotmail.com
Sign In or Register to comment.