Acumatica 使用图形插入销售订单

Acumatica 使用图形插入销售订单,acumatica,Acumatica,您好,我正在尝试使用SOOrderEntry图保存销售订单,但我相信我的字段中缺少阻止插入的内容 这是我的代码,用于插入我在代码前面使用PXSelect获得的销售订单、客户和项目 PX.Objects.SO.SOOrderEntry graph = PXGraph.CreateInstance<PX.Objects.SO.SOOrderEntry>(); graph.Clear(PXClearOption.ClearAll);

您好,我正在尝试使用SOOrderEntry图保存销售订单,但我相信我的字段中缺少阻止插入的内容

这是我的代码,用于插入我在代码前面使用PXSelect获得的销售订单、客户和项目

   PX.Objects.SO.SOOrderEntry graph = PXGraph.CreateInstance<PX.Objects.SO.SOOrderEntry>();
            graph.Clear(PXClearOption.ClearAll);

            PX.Objects.SO.SOOrder order = new PX.Objects.SO.SOOrder();

            graph.Document.Current = order;
            order.OrderType = "SO";
            order = graph.Document.Insert(order);

            order.OrderDate = DateTime.Now;
            order.RequestDate = DateTime.Now;
            order.Status = "N";

            order.CustomerID = cust.BAccountID;
            order.ProjectID = project.ID;

            graph.Document.Update(order);
            graph.Actions.PressSave();
PX.Objects.SO.SOOrderEntry graph=PXGraph.CreateInstance();
graph.Clear(PXClearOption.ClearAll);
PX.Objects.SO.SOOrder order=新PX.Objects.SO.SOOrder();
graph.Document.Current=订单;
order.OrderType=“SO”;
订单=图形.文档.插入(订单);
order.OrderDate=DateTime.Now;
order.RequestDate=DateTime.Now;
order.Status=“N”;
order.CustomerID=cust.BAccountID;
order.ProjectID=project.ID;
图.文件.更新(顺序);
graph.Actions.PressSave();
试试这个

        PX.Objects.SO.SOOrderEntry graph = PXGraph.CreateInstance<PX.Objects.SO.SOOrderEntry>();         

        PX.Objects.SO.SOOrder Sorder = new PX.Objects.SO.SOOrder();

        Sorder.OrderType = SOOrderTypeConstants.SalesOrder;
        Sorder = graph.Document.Insert(Sorder);

        Sorder.OrderDate = DateTime.Now;
        Sorder.RequestDate = DateTime.Now;
        Sorder.Hold = false;

        Sorder.CustomerID = cust.BAccountID;
        Sorder.ProjectID = project.ID;

        graph.Document.Update(Sorder);
        graph.Actions.PressSave();
PX.Objects.SO.SOOrderEntry graph=PXGraph.CreateInstance();
PX.Objects.SO.SOOrder Sorder=新的PX.Objects.SO.SOOrder();
Sorder.OrderType=SOOrderTypeConstants.SalesOrder;
Sorder=graph.Document.Insert(Sorder);
Sorder.OrderDate=DateTime.Now;
Sorder.RequestDate=DateTime.Now;
Sorder.Hold=false;
Sorder.CustomerID=cust.BAccountID;
Sorder.ProjectID=project.ID;
图.文件.更新(排序);
graph.Actions.PressSave();

如果有错误,请说明是什么。

您是否收到任何错误消息?