Options

Nav 2009 webservice-sales line with sales header issue

abhishekpareekabhishekpareek Member Posts: 150
edited 2010-12-31 in NAV Three Tier
Hello All,

I am building a data grid in C#. In that grid, I have to populate the Sales header on Grid in C# by using Navision webservice 2009 sp1. Now in the Second, which is Sales line grid, I want to display only relevant records of Sales header Grid. Upon selecting a record in sales header grid in C#, only relevant sales line records should be didplayed in Sales Line grid.

Problem:

Corresponding sales line is not coming. Instead, all records are getting displayed on it. This is due to non availability of Document No. field in SalesLine Page web service.
Can any body suggest that how to resolve the issue.

Thanks for help in advance!

Regards,
Abhishek Pareek

Comments

  • Options
    IsakssonMiIsakssonMi Member Posts: 77
    A simple solution would be to use a linq query to distinct the sales line records before you populate the sales line grid.
  • Options
    abhishekpareekabhishekpareek Member Posts: 150
    I appreciate you effort. In order to build the linq query, we should have the link between sales header and sales line web service. But if you see in the fields of both service, there is no 'document no' field in sales line web service.(Both sales header and sales line table are linked with No. and Document No. field. Hence on Sales Header and Sales Line page webservice, both fields should be present.)

    So my question is how to link between both.

    Regards,
    Abhishek Pareek ](*,)
  • Options
    companycompany Member Posts: 89
    Hi,

    You can access Sales Lines directly from Sales Order Page web service, there is no need to create new web service for Sales lines.

    Sample code for how to access Sales Lines. Try this.

    SalesOrder_Service slvc = new SalesOrder_Service();//Sales Order Service
    SalesOrder sr = new SalesOrder();//Sales Order(Contains Sales Header Fields and Sales Lines)
    sr = slvc.Read("Order No")
    GvSalesLines.DataSource = sr.SalesLines;//assigning Sales Lines to Grid View)
    GvSalesLines.DataBind();
  • Options
    abhishekpareekabhishekpareek Member Posts: 150
    Thanks a lot! It works...

    I am stuck wth another issue.
    Now as you know I have Sales and Sales line displayed on the C# application. Now I want to update the qty field in Sales Line through c#. The problem is that I am not able to find out the key field in Sales Line through which I can update the Sales Line. ](*,)

    Regards,
    Abhishek Pareek
  • Options
    abhishekpareekabhishekpareek Member Posts: 150
    edited 2011-07-19
    All issues are resolved and thus created a add-on in C# for Navision:

    Please visit my link.
    I had developed a addon for Navision which is using c# \:D/

    Regards,
    Abhishek Pareek
  • Options
    abhishekpareekabhishekpareek Member Posts: 150
    All issues are resolved and thus created a add-on in C# for Navision:

    I had developed a addon for Navision which is using C# \:D/

    Regards,
    Abhishek Pareek
Sign In or Register to comment.