【问题标题】:Auto confirm shipment when create shipment from Sales Order by Automation Step通过自动化步骤从销售订单创建发货时自动确认发货
【发布时间】:2015-12-07 03:05:49
【问题描述】:

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

谢谢大家。

【问题讨论】:

  • 您认为什么是自动确认?以哪种形式?
  • 在销售订单屏幕 (SO301000) 中,我点击创建装运操作,将创建状态为“打开”的装运。我希望此货件在点击操作时自动更改为“已确认”状态:在货件屏幕中确认货件 (SO302000)
  • 请澄清我是否正确理解了您的要求。看起来您想模仿单击“创建货件”按钮,然后在屏幕 SO302000 中打开创建的货件并单击确认?
  • 是的,确切地说,有关更多信息,我已经使用自定义代码来执行此操作,但它会产生许多意外错误,因此我想使用自动化步骤来确保一切都基于 Acumatica 标准运行良好
  • 您能提供您使用的自定义代码吗?

标签: acumatica


【解决方案1】:
    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;
            }
        }

我们遇到了“确认发货”的问题,上面的代码有助于解决这个问题。它从货件编号加载货件文件,找到“确认货件”的图表菜单并单击它。

【讨论】:

    【解决方案2】:

    安排流程确认发货而不是使用自动化步骤功能的最佳选择。

    【讨论】:

      猜你喜欢
      • 2023-02-01
      • 2016-01-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-25
      • 1970-01-01
      相关资源
      最近更新 更多