Acumatica,如何检查动作是否完成

Acumatica, how to check action is completed

我有一个图表调用操作创建发货,如下所示

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

而且我不知道动作什么时候完成。我怎样才能获得像 GetProcessStatus 这样的状态?

我建议你考虑安装acumatica的文件夹。有码图SOShipmentEntry.cs。 它有有趣的代码:

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

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

所以我建议你试试PXLongOperation.WaitCompletion