Hi @sysuser113 Not sure, what is the issue with the above code. I’m attaching complete code for your reference. I have verified this and it is working as expected.
using SOAP.SOAPNB; using System; using System.Collections.Generic; using System.Net;
namespace _2021R2 { class UpdateShipmentQty { Screen _context; static void Main(string[] args) { var objUpdateShipmentQty = new UpdateShipmentQty(); objUpdateShipmentQty.Initial();
var orderResults = _context.SO302000Submit(commands.ToArray());
_context.Logout(); } catch (Exception ex) {
string s = ex.Message.ToString(); _context.Logout(); } } private static void ReqParameter(SO302000Content content, ref List<Command> cmds) { if (cmds == null) throw new ArgumentNullException("cmds"); cmds = new List<Command> {
//Header Details
new Value { Value="Shipment",LinkedCommand = content.ShipmentSummary.Type,Commit=true}, new Value { Value="004103",LinkedCommand = content.ShipmentSummary.ShipmentNbr,Commit=true},
//Line Details content.Details.ServiceCommands.RowNumber, new Value { Value="1",LinkedCommand = content.Details.LineNbr,Commit=true}, new Value { Value="004103",LinkedCommand = content.Details.ShipmentNbr,Commit=true},
new Value { Value="4",LinkedCommand = content.Details.ShippedQty,Commit=true},
@Naveen B - Thanks for the reply. I have implemented your code in following format but it always update “Shipped Qty” of first row of the Detail record, even we provide different LineNbr.
(Shipment have multiple line items)
Please see my below code snippet.
try {
var commandList = new List<Command>();
commandList.Add(new Value { Value = "Shipment", LinkedCommand = SO302000.Result.ShipmentSummary.Type, Commit = true }); commandList.Add(new Value { Value = acushipmentNbr, LinkedCommand = SO302000.Result.ShipmentSummary.ShipmentNbr, Commit = true });
commandList.Add(SO302000.Result.DocumentDetails.ServiceCommands.RowNumber); commandList.Add(new Value { Value = "4", LinkedCommand = SO302000.Result.DocumentDetails.LineNbr,Commit = true }); commandList.Add(new Value { Value = acushipmentNbr, LinkedCommand = SO302000.Result.DocumentDetails.ShipmentNbr, Commit = true }); commandList.Add(new Value { Value = shipmentLines.ShippedQty.ToString(), LinkedCommand = SO302000.Result.DocumentDetails.ShippedQty, Commit = true }); commandList.Add(SO302000.Result.Actions.Save); commandList.Add(SO302000.Result.ShipmentSummary.ShipmentNbr); commandList.Add(SO302000.Result.DocumentDetails.LineNbr); var list = commandList;
SO302000Content[] SO302000Content = context.SO302000Submit(list.ToArray()); if (SO302000Content.Length > 0) { // Return the Line Number to which the record gets updated var result= SO302000Content[0].DocumentDetails.LineNbr.Value.ToString(); return true;
@Naveen B Yes, we are planning to move for REST API soon.
I have tried your code but in my case it is still update only first record of detail line item.
Please see my below code.
Acumatica 2020 R1
try {
var commandList = new List<Command>(); string acushipmentNbr="007110"; string LineNbr="4"; commandList.Add(new Key { Value = "='Shipment'", LinkedCommand = SO302000.Result.ShipmentSummary.Type }); commandList.Add(new Key { Value = "='" + acushipmentNbr + "'", LinkedCommand = SO302000.Result.ShipmentSummary.ShipmentNbr });
commandList.Add(new Key { Value = "='" + LineNbr + "'", LinkedCommand = SO302000.Result.DocumentDetails.LineNbr, Commit = true }); commandList.Add(new Key { Value = "='" + acushipmentNbr + "'", LinkedCommand = SO302000.Result.DocumentDetails.ShipmentNbr, Commit = true }); commandList.Add(new Value { Value = shipmentLines.ShippedQty.ToString(), LinkedCommand = SO302000.Result.DocumentDetails.ShippedQty, Commit = true }); commandList.Add(SO302000.Result.Actions.Save); commandList.Add(SO302000.Result.ShipmentSummary.ShipmentNbr); commandList.Add(SO302000.Result.DocumentDetails.LineNbr); var list = commandList; SO302000Content[] SO302000Content = context.SO302000Submit(list.ToArray()); if (SO302000Content.Length > 0) { // Return the Line Number to which the record gets updated var result = SO302000Content[0].DocumentDetails.LineNbr.Value.ToString(); return true;
Hi @sysuser113 Not sure, what is the issue with the above code. I’m attaching complete code for your reference. I have verified this and it is working as expected.
using SOAP.SOAPNB; using System; using System.Collections.Generic; using System.Net;
namespace _2021R2 { class UpdateShipmentQty { Screen _context; static void Main(string[] args) { var objUpdateShipmentQty = new UpdateShipmentQty(); objUpdateShipmentQty.Initial();