Page webservice: add orderlines to existing purchase order

BlackBird
Member Posts: 52
Hi everybody,
I need some (basic?) help on how to make the following work.
I'm trying to add new orderlines to an existing purchase order, but i'm receiving an error when i try to update the order.
I'm using the example of freddyk (http://blogs.msdn.com/b/freddyk/archive ... again.aspx). Each time i'm updating the order i get the message 'Message="Element \"Key\" in namespace \"urn:microsoft-dynamics-schemas/page/inkorder\" is missing from the message!"''. I can't figure out how use the Key in this example. ](*,)
Can someone please correct or give some tips how to make this code work? I published page 50 as a webservice. This is the code i wrote in VS:
PurchOrder_Service service1 = new PurchOrder_Service();
service1.UseDefaultCredentials = true;
PurchOrder order = new PurchOrder();
service1.Read("1", "PO2009-01213");
order.PurchLines = new Purchase_Order_Line[2];
order.PurchLines[1] = new Purchase_Order_Line();
order.PurchLines[1].Type = PurchOrderRef.Type.Item;
order.PurchLines[1].No = "1000";
order.PurchLines[1].Quantity = 1;
service1.Update(ref order); <---- here's the error
Any help is greatly appreciated.
I need some (basic?) help on how to make the following work.
I'm trying to add new orderlines to an existing purchase order, but i'm receiving an error when i try to update the order.
I'm using the example of freddyk (http://blogs.msdn.com/b/freddyk/archive ... again.aspx). Each time i'm updating the order i get the message 'Message="Element \"Key\" in namespace \"urn:microsoft-dynamics-schemas/page/inkorder\" is missing from the message!"''. I can't figure out how use the Key in this example. ](*,)
Can someone please correct or give some tips how to make this code work? I published page 50 as a webservice. This is the code i wrote in VS:
PurchOrder_Service service1 = new PurchOrder_Service();
service1.UseDefaultCredentials = true;
PurchOrder order = new PurchOrder();
service1.Read("1", "PO2009-01213");
order.PurchLines = new Purchase_Order_Line[2];
order.PurchLines[1] = new Purchase_Order_Line();
order.PurchLines[1].Type = PurchOrderRef.Type.Item;
order.PurchLines[1].No = "1000";
order.PurchLines[1].Quantity = 1;
service1.Update(ref order); <---- here's the error
Any help is greatly appreciated.
0
Comments
-
Really any help0
-
Hi,
I have checked the Code you have given there is a mistake in the code see the below change:
your code :
service1.Read("1", "PO2009-01213");
Changed Code:
order = service1.Read("1", "PO2009-01213");
please change the code and try.
thanks0 -
That was it indeed!
thanks a lot.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