3

我有一个图表调用操作 Create Shipment 如下

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 这样的状态?

4

1 回答 1

2

我建议您考虑安装 acumatica 的文件夹。有一个代码图 SOSshipmentEntry.cs。它有有趣的代码:

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

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

所以我建议你尝试一下 PXLongOperation.WaitCompletion

于 2015-03-29T15:05:13.597 回答