Solved

How to dynamically change connotation of action button?

  • 14 March 2022
  • 3 replies
  • 349 views

Userlevel 2

I would like to dynamically change the color (“Connotation”) of the Confirm Shipment action button (Shipment Entry screen) depending on a condition in 21R2.

Example use case: If the Package Weight is not within an allowable range of the Shipped Weight, then change the Confirm Shipment action button connotation to "Warning". Otherwise, use “Success”. This color change would provide another visual indicator to my fulfillment staff that a shipment is okay to confirm.

I’m currently using the `SOShipment_PackageWeight_FieldUpdated()` event to raise a SetPropertyException, but the warning icon is so small that it’s easily missed. I want to provide more visible feedback to the end-user to help prevent costly packaging errors.

In the 21R2 workflow editor, the color appears to be controlled by the “Connotation” selection.

It does not appear to be possible to conditionally change the connotation of the Action button using the 21R2 workflow editor. How can it be done using code? Maybe using PXScreenConfiguration? I’m unable to find any examples of this online.

icon

Best answer by Naveen Boga 14 March 2022, 17:28

View original

3 replies

Userlevel 7
Badge +17

Hi @brothe58  You can write a logic in the ROWSelected Event like below and verify.

 

  protected virtual void _(Events.RowSelected<DACNAME> eventArgs)
{
if (eventArgs.Row == null)
return;

if (somecondition)
{
createAndAuthorizePayment.SetConnotation(Data.WorkflowAPI.ActionConnotation.Danger);

}
else
{
createAndAuthorizePayment.SetConnotation(Data.WorkflowAPI.ActionConnotation.Success);

}
}

 

Hope this helps!!

Userlevel 2

Thanks! Note the Workflow/Customization Project Editor value seems to override whatever value is set via SetConnotation() in code. I had to first remove the Connotation value from the Workflow Editor.

Userlevel 7
Badge +17

Hi, @brothe58  Hope you have removed connotation from the WorkFlow engine by extending it, and you can able to set the connection through code successfully!!.

 

 

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