Skip to main content
Answer

Press two action buttons from another graph on a graph extension

  • January 27, 2023
  • 3 replies
  • 464 views

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

Best answer by Yuriy Zaletskyy

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();

 

3 replies

Forum|alt.badge.img+7
  • Captain II
  • January 27, 2023

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(); 

 


Yuriy Zaletskyy
Jr Varsity I
Forum|alt.badge.img+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();

 


Yuriy Zaletskyy
Jr Varsity I
Forum|alt.badge.img+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.