Solved

How to enable the customized fields when a document is completed.

  • 10 May 2021
  • 6 replies
  • 112 views

Userlevel 5
Badge +2

Hello,

        I learned from others that in previous Acumatica version , the fields can be enabled in “automation steps”. But I am using 2020R2, the steps of shipments are no longer allowed to use.
      I can only use “workflow and state”.

        But it does not work out, the fields are still disabled.

   

 

 

 

        Does anybody know another way to enable the customized fields and allow updating?

icon

Best answer by Naveen B 10 May 2021, 16:32

Hi @ray20 

 

In 20 R2, since the Automation steps are de-activated by default and NOT able to activate, Can you please add below RowSelected event and verify..

 

public class SOShipmentEntryExt : PXGraphExtension<SOShipmentEntry>
{
protected virtual void SOShipment_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected InvokeBaseHandler)
{
InvokeBaseHandler?.Invoke(cache, e);
SOShipment row = e.Row as SOShipment;
if (row != null)
{
Base.Document.Cache.AllowUpdate = true;

PXUIFieldAttribute.SetEnabled<SOShipmentExt.usrTestField>(cache, row, true);
}
}
}

View original

6 replies

Userlevel 6
Badge +9

Hi @ray20 

 

In 20 R2, since the Automation steps are de-activated by default and NOT able to activate, Can you please add below RowSelected event and verify..

 

public class SOShipmentEntryExt : PXGraphExtension<SOShipmentEntry>
{
protected virtual void SOShipment_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected InvokeBaseHandler)
{
InvokeBaseHandler?.Invoke(cache, e);
SOShipment row = e.Row as SOShipment;
if (row != null)
{
Base.Document.Cache.AllowUpdate = true;

PXUIFieldAttribute.SetEnabled<SOShipmentExt.usrTestField>(cache, row, true);
}
}
}

Userlevel 5
Badge +2

Hi @ray20 

 

In 20 R2, since the Automation steps are de-activated by default and NOT able to activate, Can you please add below RowSelected event and verify..

 

public class SOShipmentEntryExt : PXGraphExtension<SOShipmentEntry>
{
protected virtual void SOShipment_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected InvokeBaseHandler)
{
InvokeBaseHandler?.Invoke(cache, e);
SOShipment row = e.Row as SOShipment;
if (row != null)
{
Base.Document.Cache.AllowUpdate = true;

PXUIFieldAttribute.SetEnabled<SOShipmentExt.usrTestField>(cache, row, true);
}
}
}

 

Yes, code master. Thank you so much. I just did, it works.
Fantastic,  you are the best.

Userlevel 5
Badge +2

@Naveen B 
Hello, and to who are also interested

I have verified that, both the “modify in either automation steps or in workflow” and “codes in rowselect” are needed to enable the fields.

Userlevel 6
Badge +9

Yes @ray20  Acumatica is disabling the fields in the code level as well as Automation Steps/Workflow once the document is changed to “Completed” status

 

Unfortunately the same scenario didn’t worked out for me in case of SOLine DAC

I want to enable custom field in SOLine and SOShipLine DAC. Can anyone show us the directions.

Thanks

Userlevel 6
Badge +9

Hi @sd79  You need to enable the field from Workflows as well as you need to have the below code.

You can refer this link if you have any doubts.

 

public class SOShipmentEntryExt : PXGraphExtension<SOShipmentEntry>
{
protected virtual void SOShipLine_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected InvokeBaseHandler)
{
InvokeBaseHandler?.Invoke(cache, e);
SOShipLine row = e.Row as SOShipLine;
if (row != null)
{
Base.Document.Cache.AllowUpdate = true;
Base.Transactions.Cache.AllowUpdate = true;

PXUIFieldAttribute.SetEnabled<SOShipLineExt.usrTestField>(cache, row, true);
}
}
}


public class SOOrderEntryExt : PXGraphExtension<SOOrderEntry>
{
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.usrTestField>(cache, row, true);
}
}
}

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 — 2020  Acumatica, Inc. All rights reserved