Acumatica 通过自动化步骤从销售订单创建发货时自动确认发货

Acumatica 通过自动化步骤从销售订单创建发货时自动确认发货,acumatica,Acumatica,作为标题,我想在通过自动化步骤从销售订单屏幕创建发货时自动确认发货 谢谢大家。计划流程确认发货而不是使用自动化步骤功能的最佳选项。soshipmentry docgraph=PXGraph.CreateInstance(); SOShipmentEntry docgraph = PXGraph.CreateInstance<SOShipmentEntry>(); docgraph.Document.Current = docgraph.Document.Search&

作为标题,我想在通过自动化步骤从销售订单屏幕创建发货时自动确认发货


谢谢大家。

计划流程确认发货而不是使用自动化步骤功能的最佳选项。

soshipmentry docgraph=PXGraph.CreateInstance();
    SOShipmentEntry docgraph = PXGraph.CreateInstance<SOShipmentEntry>();
    docgraph.Document.Current = docgraph.Document.Search<SOShipment.shipmentNbr>(ShipmentNbr);
    foreach (var action in (docgraph.action.GetState(null) as PXButtonState).Menus)
                                        {
                                            if (action.Command == "Confirm Shipment")
                                            {
                                                PXAdapter adapter2 = new PXAdapter(new DummyView(docgraph, docgraph.Document.View.BqlSelect, new List<object> { docgraph.Document.Current }));
                                                adapter2.Menu = action.Command;
                                                docgraph.action.PressButton(adapter2);

                                                TimeSpan timespan;
                                                Exception ex;
                                                while (PXLongOperation.GetStatus(docgraph.UID, out timespan, out ex) == PXLongRunStatus.InProcess)
                                                { }
                                                break;
                                            }
                                        }



internal class DummyView : PXView
        {
            List<object> _Records;
            internal DummyView(PXGraph graph, BqlCommand command, List<object> records)
                : base(graph, true, command)
            {
                _Records = records;
            }
            public override List<object> Select(object[] currents, object[] parameters, object[] searches, string[] sortcolumns, bool[] descendings, PXFilterRow[] filters, ref int startRow, int maximumRows, ref int totalRows)
            {
                return _Records;
            }
        }
docgraph.Document.Current=docgraph.Document.Search(ShipmentNbr); foreach(var action in(docgraph.action.GetState(null)作为PXButtonState)。菜单) { 如果(action.Command==“确认装运”) { PXAdapter adapter2=新PXAdapter(新DummyView(docgraph,docgraph.Document.View.BqlSelect,新列表{docgraph.Document.Current})); adapter2.Menu=action.Command; docgraph.action.按下按钮(适配器2); 时间跨度时间跨度; 例外情况; while(PXLongOperation.GetStatus(docgraph.UID,out timespan,out ex)=PXLongRunStatus.InProcess) { } 打破 } } 内部类DummyView:PXView { 记录清单; 内部DummyView(PXGraph图形、BqlCommand命令、列表记录) :base(图形、真值、命令) { _记录=记录; } 公共覆盖列表选择(对象[]当前、对象[]参数、对象[]搜索、字符串[]排序列、布尔[]下降、PXFilterRow[]过滤器、ref int startRow、int maximumRows、ref int totalRows) { 退货记录; } }

我们在“确认装运”方面有问题,上面的代码有助于做到这一点。它将出货文件从出货编号中载入,并找到“确认装运”的图表的菜单并点击它。

你认为自动确认是什么?在哪种形式?在销售订单屏幕(SO301000)中,我单击创建装运操作,将创建状态为“打开”的装运。我希望此装运将自动更改为“已确认”状态,因为单击操作:在装运屏幕(SO302000)中确认装运。请澄清我是否正确理解您的请求。看起来您想模拟单击按钮“创建装运”,然后在屏幕SO302000中打开创建的装运,然后单击确认?是的,确切地说,有关详细信息,我使用了定制代码来实现这一点,但它会导致许多意外错误,因此我想使用自动化步骤来确保一切都基于Acumatica标准。您可以提供您使用的定制代码吗?