Option Variable Web service Nav 2009R2
Belias
Member Posts: 2,998
hi everyone, YES...i still work with NAV but i really have so little time to write to my favourite forum 
I need your help: i've published a list page as web service and i specified some fields and a pair of variables..
-First question: will the variables be correctly evaluated in this list, as soon as i populate them in the onaftergetrecord field?
-Second question: my colleague is working on the web part that will consume the web service. He can see and use Mytextvariable, but he cannot see MyOptionVariable in the wsdl...is it normal or are we doing something wrong?
thanks in advance
I need your help: i've published a list page as web service and i specified some fields and a pair of variables..
-First question: will the variables be correctly evaluated in this list, as soon as i populate them in the onaftergetrecord field?
-Second question: my colleague is working on the web part that will consume the web service. He can see and use Mytextvariable, but he cannot see MyOptionVariable in the wsdl...is it normal or are we doing something wrong?
thanks in advance
0
Comments
-
Can you be a bit more specific about your problem? A List Page and a Card Page do expose the very same bunch of typical CRUD (Create Update Delete) methods. It doesn't matter which one you expose because it will publish the very same methods based on the table the List or Card page is based on. (You can extend the CRUD methods of a page with those of a codeunit however if you want to). Assuming you are calling a Read method, then you can expect every normal field (no flowfields, blobs etc.) to be present in the response. You do not need to put any code in OnAfterGetRecord triggers. Regarding your second question: Only simple type parameters like text strings are to be used with webservices as input parameters, so exotic typical NAV parameters like options or recs cannot be used and will not be visible in a WSDL. If you want to expose these kind of functions, write a wrapper function around them to convert simple input strings to intergers, options, recs and so on.0
-
1. i mean that i have a pair of variables in my list that are shown to the user as additional columns (they are calculated values based on some other tables, and they cannot be flowfields). I am populating those variables in onaftergetrecord, so i am asking if they will be correctly shown into a web page.
2. one of these variables are options. I wonder why i cannot see my option variable in the wsdl if i can see the "document type" field, for example.
I WANT TO REMARK THIS: the option variable is not randomly put in my code and used for some calculation. It IS shown in the page as a column. It resembles a normal field, to the user...except it is not editable/filterable0 -
Pages really only expose the CRUD methods and therefore they are an interface to the tables and fields. Only real database fields excluding blobs are exposed. Other variables and flowfields will not be exposed as a field because they are no field. If you can't insert, modify or delete your value, then it won't show up in the WSDL. You can create a codeunit which returns your desired value and expose that codeunit as a webservice. You can merge the methods of that codeunit with the CRUD methods of the page if you want to, but that is not neccesary. For performance reasons, you might want to cache the values in your application to reduce the number of webservices being called.0
-
Yes they are correctly shown in the webpage.Belias wrote:1. i mean that i have a pair of variables in my list that are shown to the user as additional columns (they are calculated values based on some other tables, and they cannot be flowfields). I am populating those variables in onaftergetrecord, so i am asking if they will be correctly shown into a web page.
Unfortunately option variable niether shows up in the page object nor as a enum.Belias wrote:2. one of these variables are options. I wonder why i cannot see my option variable in the wsdl if i can see the "document type" field, for example.0 -
:-k
this is a chunck of wsdl:<xsd:simpleType name="PalmSerialNo_Fields"> - <xsd:restriction base="xsd:string"> <xsd:enumeration value="Code" /> <xsd:enumeration value="Blocked" /> <xsd:enumeration value="Item_No" /> <xsd:enumeration value="ItemDescription" /> !!!!!!!!!!!! <xsd:enumeration value="Last_Inv_Reason_Code" /> <xsd:enumeration value="Last_Entry_No" /> <xsd:enumeration value="Last_Source_Type" /> <xsd:enumeration value="Last_Source_Code" /> <xsd:enumeration value="Posted_Series_No" /> <xsd:enumeration value="Document_No" /> <xsd:enumeration value="Location_Code" /> <xsd:enumeration value="Responsibility_Center_Code" /> <xsd:enumeration value="Vendor_Serial_No" /> <xsd:enumeration value="Ship_to_Code" /> <xsd:enumeration value="Ship_to_Patient" /> <xsd:enumeration value="Patient_Code" /> <xsd:enumeration value="Our_Property" /> <xsd:enumeration value="Property_Type" /> <xsd:enumeration value="Property_No" /> <xsd:enumeration value="Certificate" /> <xsd:enumeration value="Customer_Warranty_Date" /> <xsd:enumeration value="Lot_No" /> <xsd:enumeration value="Inventory_No" /> <xsd:enumeration value="OTType" /> !!!!!!!!!!!!
i marked a pair of values with "!"..these values are only variables, not fields...i agree with you that it's strange to expose such things, but it's just the beginning of this project and we're testing some things. The web developer can "consume" ItemDescription (i've asked him if he can show it up correctly), but cannot consume OTType field.
EDIT: thanks pawanp.0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions