Skip to main content
Solved

How to make a customized field editable when PO is in Open status


Hello all,

I have tried to modify the current workflow as:
 

This Test Workflow is an extension of RO Workflow

But still when the PO is in Open status. the field (Time Only Value) is still disabled.
 


What is it that I am missing here?

7 replies

Userlevel 6
Badge +4

Hi @Harshita , I believe the steps you have followed are correct and and it should enable the field.

 

If from workflow, it is not working, you can add below code snippet to the POOrderEntry extension graph to make it enable.

 

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

if (row == null) return;

var itemExt = row.GetExtension<POLineExt>();
if (itemExt == null) return;


POOrder order = PXSelect<POOrder,
Where<POOrder.orderType, Equal<Required<POOrder.orderType>>,
And<POOrder.orderNbr, Equal<Required<POOrder.orderNbr>>>>>
.Select(Base, row.OrderType, row.OrderNbr);

if (order != null && order.Status == POOrderStatus.Open)
{
PXUIFieldAttribute.SetEnabled<POLineExt.usrCustomField>(cache, row, true);
}
else
{
PXUIFieldAttribute.SetEnabled<POLineExt.usrCustomField>(cache, row, false);
}
}

Hope, it helps!

 

Userlevel 7
Badge +19

@Harshita  Please use the below article for your reference.

 

https://asiablog.acumatica.com/2021/10/enable-customization-fields-when-document-is-completed.html

Userlevel 6
Badge +3

Hi @Harshita , I believe the steps you have followed are correct and and it should enable the field.

 

If from workflow, it is not working, you can add below code snippet to the POOrderEntry extension graph to make it enable.

 

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

if (row == null) return;

var itemExt = row.GetExtension<POLineExt>();
if (itemExt == null) return;


POOrder order = PXSelect<POOrder,
Where<POOrder.orderType, Equal<Required<POOrder.orderType>>,
And<POOrder.orderNbr, Equal<Required<POOrder.orderNbr>>>>>
.Select(Base, row.OrderType, row.OrderNbr);

if (order != null && order.Status == POOrderStatus.Open)
{
PXUIFieldAttribute.SetEnabled<POLineExt.usrCustomField>(cache, row, true);
}
else
{
PXUIFieldAttribute.SetEnabled<POLineExt.usrCustomField>(cache, row, false);
}
}

Hope, it helps!

 

Hello @Harshita , shall I use this as graph extension?
 

or this?
 

 

Userlevel 6
Badge +4

Hi @Harshita ,

You can use POOrderEntry graph to extend as your first screenshot.

Userlevel 6
Badge +3

Hi @Harshita ,

You can use POOrderEntry graph to extend as your first screenshot.

shall I add the code between #region Event handlers?

Userlevel 7
Badge +19

Yes @Harshita Since you are non technical it will be difficult for you to write the code. I would highly recommend you to complete the Developer Certification so that you will get the basics about the development tasks.

Userlevel 6
Badge +4

Yes, it's a good practice to add the event handler code within the #regionsection to maintain code organization and readability. This helps keep related code together and makes it easier to manage and navigate through the codebase.

 

Reply