Access metadata via Webservices

anshpat2826anshpat2826 Member Posts: 44
edited 2010-02-09 in NAV Three Tier
Hello friends hope i am going to post proper question.
I am working on .net and navision integration.
currently i am facing problem in getting data of option field.
I can get the data

row["field type"] = serviceHelper.Fields["field type"].GetValue(objectname);
But this will give me data stored in table i want to get all values from
Optionstring
Optioncaption


so any one can guide me how to get restriction values ...
Himanshu Patel
Navision Consultant(Technical and Functional)
Phone No: 09979876474
Email : anshpat2826@gmail.com

Comments

  • freddy.dkfreddy.dk Member, Microsoft Employee Posts: 360
    I recognize this as being the dynamic Web Services access - you can get the field type I think by

    Type type = serviceHelper.Fields["field type"].fieldType

    and you can get the possible values by

    string[] values = Enum.GetValyes(type);

    but you do not have access to the translated values - through Web Services you only have access to the enum programmatic values.
    If you need access to further metadata you will have to create a codeunit and read the object metedata table to get to these data.
    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.
  • anshpat2826anshpat2826 Member Posts: 44
    freddy.dk wrote:
    I recognize this as being the dynamic Web Services access - you can get the field type I think by

    Type type = serviceHelper.Fields["field type"].fieldType

    and you can get the possible values by

    string[] values = Enum.GetValyes(type);

    but you do not have access to the translated values - through Web Services you only have access to the enum programmatic values.
    If you need access to further metadata you will have to create a codeunit and read the object metedata table to get to these data.

    sir,
    I already applied this code but as you can see we have stored all option string values in restriction.
    But i want to get properties related to filter the data.
    like i have added Table Relation : "Item Unit of Measure".Code WHERE (Item No.=FIELD(No.))
    so how to achive this kind of functionality in .net.
    Can you guide me how to do ?
    Himanshu Patel
    Navision Consultant(Technical and Functional)
    Phone No: 09979876474
    Email : anshpat2826@gmail.com
  • freddy.dkfreddy.dk Member, Microsoft Employee Posts: 360
    As stated in the other mail, you would have to create a codeunit and read the object metadata for the page and the table and use that to get access to more metadata. Remember though that the metadata format is not public, meaning that this can and will change.
    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.
  • anshpat2826anshpat2826 Member Posts: 44
    freddy.dk wrote:
    As stated in the other mail, you would have to create a codeunit and read the object metadata for the page and the table and use that to get access to more metadata. Remember though that the metadata format is not public, meaning that this can and will change.
    so when meta data format is changed i need to update my code unit as per new format?
    Himanshu Patel
    Navision Consultant(Technical and Functional)
    Phone No: 09979876474
    Email : anshpat2826@gmail.com
  • freddy.dkfreddy.dk Member, Microsoft Employee Posts: 360
    Yes - so if you go there, use XPath and have decent error handling that will tell you that something changed.
    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.
  • anshpat2826anshpat2826 Member Posts: 44
    Any Link from where i can have guidance about such kind of code unit ?
    Himanshu Patel
    Navision Consultant(Technical and Functional)
    Phone No: 09979876474
    Email : anshpat2826@gmail.com
  • anshpat2826anshpat2826 Member Posts: 44
    OK i solved problem regarding dynamic table look up and drill down ...
    I take lots of time but at last i got success for table relation and any query regarding web client and integration of Navision and .net welcome.
    So Now almost my most of query regarding web service solved thanks freddyK he helped me a Lot is this project.
    Any one who want to share knowledge welcome.
    also for good reason any one can call me i am open for all who want to share their knowledge across people.

    Thanks To all who helped me a Lots and also i am very Much thankful to Mibuso
    Himanshu Patel
    Navision Consultant(Technical and Functional)
    Phone No: 09979876474
    Email : anshpat2826@gmail.com
Sign In or Register to comment.