NAV2013R2 SOAP WebService Datatype issue

andrewt
Member Posts: 73
Hi all,
I am facing a datatype issue when sending data through a published SOAP Page webservice into NAV. All fields of type Text or Code are properly set with the assigned values while other field types like integer or date remain blank (zero).
The NAV SOAP Webservie has a published Page object. The code piece which I used for testing is as follows:
The string values are received correctly by the NAV record fields, all other field types are not and remain blank or 0.
I used VS 2012 for testing.
Any ideas or hints why this is happening and how to resolve it ?
Thanks in advance
Andrew
I am facing a datatype issue when sending data through a published SOAP Page webservice into NAV. All fields of type Text or Code are properly set with the assigned values while other field types like integer or date remain blank (zero).
The NAV SOAP Webservie has a published Page object. The code piece which I used for testing is as follows:
RequisitionBuffer_Service service = new RequisitionBuffer_Service(); service.UseDefaultCredentials = true; RequisitionBuffer ReqBuffer = new RequisitionBuffer(); ReqBuffer.External_Request_ID = "EXT000001"; ReqBuffer.External_Request_Line_No = 10000; ReqBuffer.IMO_No = "9531662"; ReqBuffer.Port_of_Delivery = "DE HAM"; ReqBuffer.Requested_Receipt_Date = new DateTime(2014, 8, 24); ReqBuffer.Type = Type.Catalog_Service; ReqBuffer.No = "IMPA000101"; ReqBuffer.Description = "ASPARAGUS GREEN FRESH"; ReqBuffer.Quantity = 100; ReqBuffer.Unit_of_Measure_Code = "KGR"; ReqBuffer.Status = Status.Pending; service.Create(ref ReqBuffer);
The string values are received correctly by the NAV record fields, all other field types are not and remain blank or 0.
I used VS 2012 for testing.
Any ideas or hints why this is happening and how to resolve it ?
Thanks in advance
Andrew
0
Answers
-
What I remember is, that when you are using page as webservice and you are using create function, it is filling only primary keys. I recommend to use create to create the record and than update/modify to modify the rest of the record.0
-
Hello Kamil,
great hint, that works !
I followed your recomendation and used Create only for the initial record creation and then Update to write the record data. All data is now received properly by the NAV record according to the different data types. The modified .NET code piece is attached below.
Thanks for your fast response and the great support. Easy to fix if you know how - I like these resolutions...
Cheers
AndrewRequisitionBuffer_Service service = new RequisitionBuffer_Service(); service.UseDefaultCredentials = true; RequisitionBuffer ReqBuffer = new RequisitionBuffer(); service.Create(ref ReqBuffer); ReqBuffer.External_Request_ID = "EXT000001"; ReqBuffer.External_Request_Line_No = 10000; ReqBuffer.IMO_No = "9531662"; ReqBuffer.Port_of_Delivery = "DE HAM"; ReqBuffer.Requested_Receipt_Date = new DateTime(2014, 8, 24); ReqBuffer.Type = Type.Catalog_Service; ReqBuffer.No = "IMPA000101"; ReqBuffer.Description = "ASPARAGUS GREEN FRESH"; ReqBuffer.Quantity = 100; ReqBuffer.Unit_of_Measure_Code = "KGR"; ReqBuffer.Status = Status.Pending; service.Update(ref ReqBuffer);
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions