Skip to main content
Solved

Make a Custom Field Available on All Workflow Steps

  • Aug 18, 2021 3:19 PM UTC
  • 3 replies
  • 646 views
  • Translate All

Ahmed
Varsity II
Forum|alt.badge.img+1

I’ve created a new dropdown field for the SOLine “Return Reason” but am unable to edit this field when the Sales Order status is Completed (because the workflow step prevents it). Even after Re-opening the order I’m unable to edit the SOLine that is completed including this field.

So I tried adding a new workflow:

Modifying the Open and Backorder step (the act of re-opening a Completed order puts it in the Open/Backorder status) by adding the Return Reason:

 

But the field still stays locked:

 

Am I missing something with the workflow editor?
Is there a simple parameter I can add to the DAC field?

Best answer by Naveen Boga

Hi @abahar14  I worked on this and I’m able to able modify the field when Order status is in Completed/Shipping/Cancelled as well.

The thing is apart from workflow changes also we need to have small piece of code to enable this field. I have attached code and screenshots for reference.

 

 public class SOOrderEntry_Extension : PXGraphExtension<SOOrderEntry>
{
#region Event Handlers

protected virtual void SOLine_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected InvokeBaseHandler)
{
InvokeBaseHandler?.Invoke(cache, e);
SOLine row = e.Row as SOLine;
if (row != null)
{
Base.Document.Cache.AllowUpdate = true;
Base.Transactions.Cache.AllowUpdate = true;
PXUIFieldAttribute.SetEnabled<SOLineExt.usrReturnReason>(cache, row, true);
}
}

#endregion
}

 

 

 

View original

3 replies

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Answer
  • Aug 20, 2021 1:13 PM UTC

Hi @abahar14  I worked on this and I’m able to able modify the field when Order status is in Completed/Shipping/Cancelled as well.

The thing is apart from workflow changes also we need to have small piece of code to enable this field. I have attached code and screenshots for reference.

 

 public class SOOrderEntry_Extension : PXGraphExtension<SOOrderEntry>
{
#region Event Handlers

protected virtual void SOLine_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected InvokeBaseHandler)
{
InvokeBaseHandler?.Invoke(cache, e);
SOLine row = e.Row as SOLine;
if (row != null)
{
Base.Document.Cache.AllowUpdate = true;
Base.Transactions.Cache.AllowUpdate = true;
PXUIFieldAttribute.SetEnabled<SOLineExt.usrReturnReason>(cache, row, true);
}
}

#endregion
}

 

 

 

Translate

Ahmed
Varsity II
Forum|alt.badge.img+1
  • Author
  • Varsity II
  • Aug 20, 2021 9:20 PM UTC

Thank you Naveen! Acumatica support also confirmed that coding is necessary here as some screens are controlled by code and workflows… SO screen being one.

I’ve added an idea so that this code can be generated automatically as part of the workflow customization if people would like to vote for it:

 

Translate

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Aug 22, 2021 12:48 AM UTC

Thanks for the update @abahar14 and voted 🙂

Translate