Retrieving specified fields from NAV tables using Web Servic

SivaMohanYerramsettySivaMohanYerramsetty Member Posts: 26
edited 2009-02-20 in NAV Three Tier
Hi everyone,

Using web services, I am displaying Customer (accessing NAV data) details in ASP.Net application using GridView control. Here problem is I don’t want to display all fields from Customer table. I can put filters on customer data. But, I am unable to retrieve specified fields from customer table.
Can anyone tell the solution for this issue?
protected void Button1_Click(object sender, EventArgs e)
    {
        CustWS.CustomerPage_Service CustServices = new CustomerPage_Service();
        CustServices.UseDefaultCredentials = true;
        CustServices.Url = "http://b2bxpprof247:7047/DynamicsNAV/WS/CRONUS_India_Ltd./Page/CustomerPage";
        CustWS.CustomerPage CustRec = new CustomerPage();

        List<CustomerPage_Filter> filterArray = new List<CustomerPage_Filter>();
        CustomerPage_Filter CustFilter = new CustomerPage_Filter();
        CustFilter.Field = CustomerPage_Fields.Name;
        CustFilter.Criteria = "@s*";
        filterArray.Add(CustFilter);
        GridView1.DataSource = CustServices.ReadMultiple(filterArray.ToArray(), null, 100);
        GridView1.DataBind();

    }
Shiv

Comments

  • ara3nara3n Member Posts: 9,255
    Oops Never mind.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • kinekine Member Posts: 12,562
    If you mean something like "dynamic" WebService which will return you just somehow selected fields, you will need to use some codeunit and programming. You cannot do it only by publishing page.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • ara3nara3n Member Posts: 9,255
    Have you tried to create a new page with only the fields you want to display.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • SivaMohanYerramsettySivaMohanYerramsetty Member Posts: 26
    Thanks for ur replay,
    I'll work on this.
    Shiv
  • SivaMohanYerramsettySivaMohanYerramsetty Member Posts: 26
    Hi Rashed,
    I have created one page with specified fields from customer table. By using this page am getting the same fields in my application but, still one unknown key it’s displaying.
    How can I restrict this?
    Shiv
  • kinekine Member Posts: 12,562
    still one unknown key

    ??? Can you be more specific?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • SivaMohanYerramsettySivaMohanYerramsetty Member Posts: 26
    What I feel, this key (Unique identifier) is might be generating by Web service for getting current record from NAV database.

    The key is like : 300;EgAAAACJDAxEyAAAAAAAAAAAAAAAAA……….AAAAAAAAAA=4;49920
    Shiv
  • kinekine Member Posts: 12,562
    Yes, it is. This key must be part of the dataset to be able to identify the record...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • SivaMohanYerramsettySivaMohanYerramsetty Member Posts: 26
    Then, how can I display the data with out this key in Web Page?
    any suggestions?
    Shiv
  • kinekine Member Posts: 12,562
    Define which columns you want to dsiplay, displaying all data you read is not the correct way for any web application...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.