Xavier LARTEM
Xavier LARTEM

Reputation: 139

Acumatica / problem updating a free field in a closed invoice

When I update the usrDocCom field, I get the error message:

Error: Updating 'SO Invoice' record raised at least one error. Please review the errors. Error: 'Project' cannot be empty.

I tried to remove the controls from the project field, but without result

    protected void ARTran_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected InvokeBaseHandler)
{
  if(InvokeBaseHandler != null)
    InvokeBaseHandler(cache, e);

   var row = (ARTran) e.Row;

    if (row != null )
    {
      PXUIFieldAttribute.SetEnabled(cache, row, false);
      PXUIFieldAttribute.SetEnabled<ARTranExt.usrDocCom>(cache, row, true);  
    }
}

    protected void ARInvoice_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected InvokeBaseHandler)
{
  if(InvokeBaseHandler != null)
    InvokeBaseHandler(cache, e);
  var row = (ARInvoice)e.Row;

  **Base.Transactions.Cache.AllowUpdate = true;** // permet de mettre à jour les informations libre des lignes
  
}

Thanks Xavier

Upvotes: 0

Views: 200

Answers (1)

Chris H
Chris H

Reputation: 765

Two things...

  1. be sure the project field has at least the non-project code assigned. Usually the value is represented by 'X'
  2. it is recommended that you create a workflow and set the enabled property as true, in the Completed/Closed state of the invoice.

Upvotes: 1

Related Questions