Solved

Press two action buttons from another graph on a graph extension

  • 27 January 2023
  • 3 replies
  • 237 views

Userlevel 2

Hay guys

Does anyone have an opinion on the best way to press two action buttons from another graph on a graph extension?

More Specifically I want to press the “Print Courier Label” action button and the “Confirm Shipment” action button from my pick/pack/ship screen.

Do I need to bite the bullet and learn how to edit the ASPX page?

Or can I trigger it in a graph extension?

 

I tried using an event handler, but I must have done it wrong, couldn’t get it working.

 

I couldn’t get it working in the workflow editor either as the existing actions are on the Shipment screen and I want to Action them from the pick/pack/ship screen.

 

If someone could steer me in the wright direction I can figure out the rest, i.e., what type of methods

Thank you

icon

Best answer by Yuriy Zaletskyy 27 January 2023, 19:40

View original

3 replies

Userlevel 5
Badge +3

From the side of looking for answer, I’d suggest you next time mention this in the question:

I need to call two actions xxx, and yyy, which are on the screen: “name of the screen”, screenid is zzz. In such case it will be easier to give you more precise answer.

Userlevel 5
Badge +3

Do I need to bite the bullet and learn how to edit the ASPX page?

 

I believe not.

More Specifically I want to press the “Print Courier Label” action button and the “Confirm Shipment” action button from my pick/pack/ship screen.

I’d assume, that you’ve created graph like this:

var graph = PXGraph.CreateInstance<SOOrderEntry>();
//load graph with some sales order

in that scenario, all avaialable actions will be in collection Actions. You need to find out which action is responsible for some activity in C#. I’d assume, that Print Courier Label is described in Acumatica with name “PrintCourierLabel”, and button Confirm Shipment is described as “ConfirmShipment”.

you can call anyone of them like this:

graph.Actions["PrintCourierLabel"].Press();
// Potentially you may need
// PXLongOperation.WaitCompletion(graph.UID);
graph.Actions["ConfirmShipment"].Press();

 

Userlevel 7
Badge +5

You can trigger it via a graph extension. Here’s a very short example that assumes that the shipment record is in the variable called shipment:

SOShipmentEntry shipmentEntry = PXGraph.CreateInstance<SOShipmentEntry>();
shipmentEntry.Document.Current = shipment;
shipmentEntry.putOnHold.Press();

You can also press the button via the action name as well:

 poGraph.Actions["Process"].Press(); 

 

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