Solved

Make certain fields editable based SO Lines for closed order

  • 12 April 2023
  • 3 replies
  • 145 views

Userlevel 6
Badge +3

This is almost a duplicate of this post 

https://community.acumatica.com/develop-customizations-288/make-certain-fields-editable-based-on-po-status-15192

I’ve tried the suggestions on that post but it is not resolving my issue.

I am trying to make two fields editable when the SO is CLOSED.  I’ve modified the Workflow as follows:

I added code as well:

namespace PX.Objects.SO
{
  public class SOOrderEntry_Extension : PXGraphExtension<PX.Objects.SO.SOOrderEntry>
  {
    #region Event Handlers
    protected void SOLine_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected baseHandler)
    {
        baseHandler?.Invoke(cache, e);
        var row = (SOLine)e.Row;

        PXUIFieldAttribute.SetEnabled<FSxSOLine.sDSelected>(cache, row, true);
        PXUIFieldAttribute.SetEnabled<SOLine.requestDate>(cache, row, true);

    }
    #endregion
  }
}

The fields are still not editable.

I am thinking that the update cache option for the SO Lines is disabled for a closed order.  If that is the case, maybe there is no way to enable them.

Any suggestions?

icon

Best answer by Naveen Boga 13 April 2023, 06:54

View original

3 replies

Userlevel 7
Badge +17

Hi, @Joe Schmucker  Hope you are doing well!

We can enable the fields even after the Sales Order document is moved to COMPLETED status as well.

I have done minor changes to the code and workflow steps and fields are enabled and able to modify as well.

 

Please find the attached screenshot and customization package for your reference.

 

Userlevel 6
Badge +3

@Naveen Boga 

Thank you Naveen.  I thought it might have had to do with the cache being disabled for the grid.  Thanks for showing me how!

These are the lines I was missing:

                    Base.Document.Cache.AllowUpdate = true;
                    Base.Transactions.Cache.AllowUpdate = true;
Also, it is freaky that the project name you created was exactly the same as the one I created!  😀

When I imported your project, I was confused that there were two with the same name!  HAHA!

It works now. 

As always, thank you for your time and gracious assistance.

Userlevel 7
Badge +17

Hi, @Joe Schmucker  HAHA... It Happens :) !!

Thanks a lot for confirming that the solution is working fine :)

 

 

 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved