Attempt A: setting up page 42 and 46 both as web services, called SOPage and SOLinesPage.SOService.SOPage_Service serv = new EnterSalesOrder.SOService.SOPage_Service();
serv.UseDefaultCredentials = true;
serv.Url = "http://localhost:7047/DynamicsNAV/WS/CRONUS_UK_Ltd/Page/SOPage";
SOService.SOPage page = new SOService.SOPage();
page.Sell_to_Customer_No = "10000";
SOLinesService.SOLinesPage_Service lineserv = new SOLinesService.SOLinesPage_Service();
lineserv.UseDefaultCredentials = true;
serv.Url = "http://localhost:7047/DynamicsNAV/WS/CRONUS_UK_Ltd/Page/SOLinesPage";
SOLinesService.SOLinesPage lines = new SOLinesService.SOLinesPage();
lines.No = "1000";
lines.Quantity = 1;
serv.Create(ref page);
lineserv.Create(ref lines);
Problem 1: cannot specify Document No. and Line No. However, this can be probably worked around by adding them to the page.
Problem 2: getting exception: "Namespace "urn:microsoft-dynamics-schemas/page/sopage" in message is invalid, expected "urn:microsoft-dynamics-schemas/page/solinespage"
It seems it doesn't like having 2 different we services referenced?
Attempt B: try to do it all through the Sales Order Page service:SOService.SOPage_Service serv = new EnterSalesOrder.SOService.SOPage_Service();
serv.UseDefaultCredentials = true;
serv.Url = "http://localhost:7047/DynamicsNAV/WS/CRONUS_UK_Ltd/Page/SOPage";
SOService.SOPage page = new SOService.SOPage();
page.Sell_to_Customer_No = CustomerNo;
SOService.Sales_Order_Line line = new SOService.Sales_Order_Line();
line.No = "1000";
line.Quantity = 1;
serv.Create(ref page);
serv.Create(ref line);
Problem 1: again, cannot specify the Document No. and Line No. but again probably can be resolved by adding it to the page.
Problem 2: doesn't compile, "Argument '1': cannot convert from 'ref EnterSalesOrder.SOService.Sales_Order_Line' to 'ref EnterSalesOrder.SOService.SOPage'"
Apparently you cannot supply the subform as a reference to the Create of the main page.
Attempt C: same stuff, but without the last line
(hoping it will create the line too if I just Create the header, the main page: perhaps it creates every record in the page, including the subforms)
Problem: nope, simply nothing happens, no Sales Line record created.
Any other ideas?
Comments
Test Lead
Microsoft Dynamics NAV
This posting is provided "AS IS" with no warranties, and confers no rights.
Could you perhaps arrange it to get this example into the next version of NAV_ADG?
RIS Plus, LLC