Larry Dinh
Larry Dinh

Reputation: 387

Acumatica, how to check action is completed

I have a graph call action Create Shipment as below

var soshipmentEntry = PXGraph.CreateInstance<SOShipmentEntry>();
var confirmShipment =(soshipmenEntry.Actions["action"].GetState(null) as PXButtonState).Menus.FirstOrDefault(p => p.Command == "Confirm Shipment");
var adapter = new PXAdapter(new DummyView(Base, Base.Document.View.BqlSelect,
                        new List<object> { Base.Document.Current }))
                        {
                            Menu = confirmShipment.Command
                        };
soshipmentEntry.Actions["action"].PressButton(adapter);

And i don't know when action is completed. How can i get status like GetProcessStatus?

Upvotes: 3

Views: 1266

Answers (1)

Yuriy Zaletskyy
Yuriy Zaletskyy

Reputation: 5151

I propose you to consider folder where acumatica is installed. There is a code graph SOShipmentEntry.cs. It has interesting code:

    switch (actionID)
                {
                    case 1:
                        {
    .
    .
    .

    Save.Press();
    PXAutomation.CompleteAction(this);
    PXLongOperation.WaitCompletion(this.UID);
    PXLongOperation.ClearStatus(this.UID);
}

So I recommend you to give a try to PXLongOperation.WaitCompletion

Upvotes: 2

Related Questions