How To Enable Some Control In Acumatica

How to enable some control in Acumatica

Hello everybody,

today I want to leave a short note for the following situation:

Imagine that you need to enable some control in Acumatica ( for example Mark for PO ) on page Sales orders ( SO301000 ).

As usually for enabling control there are two ways:

  1. RowSelected
  2. Automation steps.

Recently I found third option, when neither 1 nor 2 did work. After spending some time I found third option: Cache has property AllowUpdate. After I've set it to true, I was able to modify lines in Document details. 

In your code it may look like this:

protected void SOLine_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected del)
{
        if (del != null)
              del(cache, e);
        SOLine row = (SOLine)e.Row;
        if (row == nullreturn;
        Base.Transactions.Cache.AllowUpdate = true;
        PXUIFieldAttribute.SetEnabled<SOLine.pOCreate>(cache, row, true);
        PXUIFieldAttribute.SetEnabled<SOLine.shipDate>(cache, row, true);
}

you still may need Row_Selected event handler, but not forget to add AllowUpdate = true.

No Comments

Add a Comment
Comments are closed