title: Updating Location and ShipQty in Acumatica Shipment Lines
body: <p>I'm having this weird problem in acumatica webservices, I'm updating existing Shipments in acumatica using webservices. My code is supposed to update the Location and ShippedQty but for no reason it updates all the items except the last one. It happens when the Shipment has multiple items. Please help me solve this problem, below is my code and an image of the Shipment screen with the last item not updated.</p>
  
  <p>Thanks.</p>
  
  <pre><code>var commands = new List&lt;Acumatica_LSOne_Integration.SO302000.Command&gt;();
          commands.Add(new SO302000.Value { Value = shipmentNbr, LinkedCommand = shipmentSchema.ShipmentSummary.ShipmentNbr });
          commands.Add(new SO302000.Value { Value = shipmentType, LinkedCommand = shipmentSchema.ShipmentSummary.Type });
          commands.Add(shipmentSchema.DocumentDetails.ShipmentNbr);
          commands.Add(shipmentSchema.DocumentDetails.LineNbr);
          commands.Add(shipmentSchema.DocumentDetails.InventoryID);
          commands.Add(shipmentSchema.DocumentDetails.Warehouse);
          commands.Add(shipmentSchema.DocumentDetails.Location);
          commands.Add(shipmentSchema.DocumentDetails.OrderedQty);
          var soLines = context.Submit(commands.ToArray());
  
          List&lt;Acumatica_LSOne_Integration.SO302000.Command&gt; commandList = new List&lt;Acumatica_LSOne_Integration.SO302000.Command&gt;();
          for (int index = 0; index &lt; soLines.Length; index++)
          {
              string sShipNbr = soLines[index].DocumentDetails.ShipmentNbr.Value;
              string sLineNbr = soLines[index].DocumentDetails.LineNbr.Value;
              string sInventoryID = soLines[index].DocumentDetails.InventoryID.Value;
              string sWarehouse = soLines[index].DocumentDetails.Warehouse.Value;
              string sLocation = soLines[index].DocumentDetails.Location.Value;
              string sOrderedQty = soLines[index].DocumentDetails.OrderedQty.Value;
  
              commandList.Add(new SO302000.Key
              {
                  ObjectName = shipmentSchema.DocumentDetails.ShipmentNbr.ObjectName,
                  FieldName = shipmentSchema.DocumentDetails.ShipmentNbr.FieldName,
                  Value = sShipNbr.Trim(), Commit = true                    
              });
  
              commandList.Add(new SO302000.Key
              {
                  ObjectName = shipmentSchema.DocumentDetails.LineNbr.ObjectName,
                  FieldName = shipmentSchema.DocumentDetails.LineNbr.FieldName,
                  Value = sLineNbr.Trim(), Commit = true                    
              });
              commandList.Add(new SO302000.Value
              {
                  Value = vLocation.Trim(),
                  LinkedCommand = shipmentSchema.DocumentDetails.Location
              });
              commandList.Add(new SO302000.Value { Value = sOrderedQty, LinkedCommand = shipmentSchema.DocumentDetails.ShippedQty,IgnoreError = true, Commit = true });
  
          }
  
          commandList.Add(shipmentSchema.Actions.ConfirmShipmentAction);
          context.Submit(commandList.ToArray());
  </code></pre>
  
  <p>Sample Output:
  <a href="https://i.stack.imgur.com/c8Z0Y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c8Z0Y.png" alt="enter image description here"></a></p>