The requirement is to enable the Customer Order Nbr when a new action ‘Change Order Nbr’ is selected. I created the below action method. It is executed on clicking the action but the field is not enabled. This is after the invoice was Released.
public PXAction<ARInvoice> ChangeOrderNbr;
[PXButton(CommitChanges = true)]
[PXUIField(DisplayName = "Change Order Nbr", Enabled = false, MapEnableRights = PXCacheRights.Delete, MapViewRights = PXCacheRights.Delete)]
protected virtual void changeOrderNbr()
{
PXUIFieldAttribute.SetEnabled<ARInvoice.invoiceNbr>(base.Base.CurrentDocument.Cache, base.Base.Document.Current, true);
// Trigger the Save action to save changes in the database.
// base.Base.Actions.PressSave();
}
Best answer by Naveen Boga
View original