I would like to update the description field with the order number. It's ok when I use the ui acumatica, but the field is empty when I use the rest webservice.
Endpoint : Salesorder?
protected void SOOrder_RowPersisted(PXCache cache, PXRowPersistedEventArgs e)
{
var row = (SOOrder)e.Row;
if (row==null) return;
BAccount un_client=PXSelect<BAccount , Where<BAccount.bAccountID, Equal<Required<BAccount.bAccountID>>>>.Select(this.Base,row.CustomerID);
if (un_client!=null)
{
row.OrderDesc=Mid(Convert.ToString(row.OrderNbr)+" (" +Convert.ToString(row.CustomerOrderNbr)+") "+Convert.ToString(un_client.AcctName),0,250);
}
}
Update 2024-03-02 When I use the SOOrder_RowPersisting
protected void SOOrder_RowPersisting(PXCache cache, PXRowPersistingEventArgs e)
{
var row = (SOOrder)e.Row;
if (row==null) return;
BAccount un_client=PXSelect<BAccount , Where<BAccount.bAccountID, Equal<Required<BAccount.bAccountID>>>>.Select(this.Base,row.CustomerID);
if (un_client!=null)
{
row.OrderDesc=Mid(Convert.ToString(row.OrderNbr)+" (" +Convert.ToString(row.CustomerOrderNbr)+") "+Convert.ToString(un_client.AcctName),0,250);
}
}


You need to use
RowPersistinginstead ofRowPersisted, and you also need to send some real data update with your request. It's OK if you send some placeholder data in the Description.