Hello all,
I have tried to modify the current workflow as:
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?
Hello all,
I have tried to modify the current workflow as:
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?
Hi
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!
https://asiablog.acumatica.com/2021/10/enable-customization-fields-when-document-is-completed.html
Hi
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
or this?
Hi
You can use POOrderEntry graph to extend as your first screenshot.
Hi
You can use POOrderEntry graph to extend as your first screenshot.
shall I add the code between #region Event handlers?
Yes
Yes, it's a good practice to add the event handler code within the #region
section to maintain code organization and readability. This helps keep related code together and makes it easier to manage and navigate through the codebase.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.