Skip to main content
Answer

Make certain fields editable based on PO status

  • March 21, 2023
  • 1 reply
  • 750 views

Forum|alt.badge.img

I need to make some fields like Promise On Date, POLine Quantity editable when the Purchase Order is on the specific Purchase Order status is Open.

How can I achieve this ??

Thanks

Best answer by Vignesh Ponnusamy

Hi @tanuj81,

You can try the following step to enable the field when the document is in Open status.

  • For this example, I extended the RO workflow to enable the fields for the Normal OrderType,

 

  • In the extended workflow add the field you need to enable and make sure Disabled checkbox is unchecked

 

  • Like below, in the graph extension enable the fields in the RowSelected event, 

    public class POOrderEntry_Extension : PXGraphExtension<PX.Objects.PO.POOrderEntry>
    {
        #region Event Handlers

        protected void POOrder_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected baseHandler)
        {
            baseHandler?.Invoke(cache, e);
            var row = (POOrder)e.Row;
            PXUIFieldAttribute.SetEnabled<POOrder.expectedDate>(cache, row, true);

        }

        protected void POLine_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected baseHandler)
        {
            baseHandler?.Invoke(cache, e);
            var row = (POLine)e.Row;
            PXUIFieldAttribute.SetEnabled<POLine.orderQty>(cache, row, true);
        }

        #endregion
    }

 

Please note the Purchase Order is set to Open status after being approved, so enabling these fields in the open status will allow the users update even after the purchase order is approved. Thanks,

1 reply

Vignesh Ponnusamy
Acumatica Moderator
Forum|alt.badge.img+5

Hi @tanuj81,

You can try the following step to enable the field when the document is in Open status.

  • For this example, I extended the RO workflow to enable the fields for the Normal OrderType,

 

  • In the extended workflow add the field you need to enable and make sure Disabled checkbox is unchecked

 

  • Like below, in the graph extension enable the fields in the RowSelected event, 

    public class POOrderEntry_Extension : PXGraphExtension<PX.Objects.PO.POOrderEntry>
    {
        #region Event Handlers

        protected void POOrder_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected baseHandler)
        {
            baseHandler?.Invoke(cache, e);
            var row = (POOrder)e.Row;
            PXUIFieldAttribute.SetEnabled<POOrder.expectedDate>(cache, row, true);

        }

        protected void POLine_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected baseHandler)
        {
            baseHandler?.Invoke(cache, e);
            var row = (POLine)e.Row;
            PXUIFieldAttribute.SetEnabled<POLine.orderQty>(cache, row, true);
        }

        #endregion
    }

 

Please note the Purchase Order is set to Open status after being approved, so enabling these fields in the open status will allow the users update even after the purchase order is approved. Thanks,