Function - Update Order Release ShipVia

Hello,

Using a REST method, I would like to update the ShipViaCode of a specified Order Release. The easiest way I found to do it is through an Epicor Function.

Problem is, testing the function does not update the ShipVia in the database.

Function is updateOrderRelShipVia(OrderNum, OrderLine, OrderRelNum, ShipViaCode)

What it does:

  1. Call BO SalesOrder.GetByID(OrderNum), which returns the SO Tableset;
  2. Set the ShipViaCode field of the specified OrderRel (retrieved by a simple query on the tableset);
  3. Call BO SalesOrder.Update(SO_Tableset).

My understanding of the BO Update method is that I can retrieve the entire tableset (with GetByID as it is an existing order), modify it, and then call Update. Am I wrong?

I have attached my library if you need to see the code (only widgets).
SalesOrderLib.efxb (177.3 KB)

As always, I appreciate your help.

Finally found what was missing.

Had to set RowMod = ā€˜Uā€™ in the dataset for the specified OrderRel. Custom code was required as RowMod field is not available in all widgets.

var orderRel = var_salesOrderTs.OrderRel.Where(dsRow=>dsRow.OrderNum == inOrderNum && dsRow.OrderLine == inOrderLine && dsRow.OrderRelNum == inOrderRel).First();
orderRel.ShipViaCode = inShipViaCode;
orderRel.RowMod = "U";