Skip to main content
Solved

Make a Custom Field Available on All Workflow Steps


Ahmed
Varsity II
Forum|alt.badge.img+1
  • Varsity II
  • 53 replies

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
Did this topic help you find an answer to your question?

3 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3404 replies
  • Answer
  • August 20, 2021

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
  }

 

 

 


Ahmed
Varsity II
Forum|alt.badge.img+1
  • Author
  • Varsity II
  • 53 replies
  • August 20, 2021

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:

https://community.acumatica.com/ideas/workflow-status-additional-field-to-work-on-any-screen-6477

 


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3404 replies
  • August 22, 2021

Thanks for the update @abahar14 and voted 🙂


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings