Acumatica 通过基于屏幕的Web服务创建SO返回抛出错误[PXRowPersistingException:error#4:';修订ID';不能为空]

Acumatica 通过基于屏幕的Web服务创建SO返回抛出错误[PXRowPersistingException:error#4:';修订ID';不能为空],acumatica,Acumatica,我们进行了webservice集成,它一直在工作,但在创建RC类型订单时,它突然开始抛出以下错误。我不明白到底出了什么问题。我们没有更新任何东西,所以我认为这是一些数据相关的问题 我通过UI尝试了相同的过程,但它没有给出这个错误。请帮忙。非常感谢你的帮助 PX.Data.PXRowPersistingException:错误#4:“修订ID”不能为空 空的 System.Web.Services.Protocols.SoapException:服务器无法运行 处理请求。-->PX.Data.PX

我们进行了webservice集成,它一直在工作,但在创建RC类型订单时,它突然开始抛出以下错误。我不明白到底出了什么问题。我们没有更新任何东西,所以我认为这是一些数据相关的问题

我通过UI尝试了相同的过程,但它没有给出这个错误。请帮忙。非常感谢你的帮助

PX.Data.PXRowPersistingException:错误#4:“修订ID”不能为空 空的

System.Web.Services.Protocols.SoapException:服务器无法运行 处理请求。-->PX.Data.PXRowPersistingException:错误#4: “修订ID”不能为空。在 PX.Data.PXDefaultAttribute.RowPersisting(PXCache发送方, PXRowPersistingEventArgs)位于 PX.Data.PXCache.OnRowPersisting(对象项,PXDBOperation操作) 在PX.Data.PXCache
1.persisted(对象行)处
PX.Objects.CS.SharedRecordAttribute.RowPersisting(PXCache发送方,
PXRowPersistingEventArgs)位于
PX.Data.PXCache.OnRowPersisting(对象项,PXDBOperation操作)
在PX.Data.PXCache处
1.persisted(对象行)在 PX.Data.PXCache
1.在
PX.Data.PXGraph.Persist(类型cacheType,PXDBOperation操作)位于
PX.Data.PXGraph.Persist()位于
PX.Objects.SO.SOShipmentEntry.Persist()位于
PX.Data.PXSave
1.d_u2.MoveNext()位于 PX.Data.PXAction
1.d_u31.MoveNext()位于
PX.Data.PXAction
1.d_u31.MoveNext()位于 PX.Api.SyImportProcessor.sysep.a(对象a_0,PXFilterRow[]a_1, PXFilterRow[]A_2)位于 PX.Api.SyImportProcessor.ExportTableHelper.ExportTable()位于 PX.Api.ScreenUtils.Submit(字符串screenId,Command[]commands, SchemaMode SchemaMode、PXGraph&graph、String&redirectContainerView、, 字符串和重定向屏幕、布尔移动、字典
2视图过滤器)
在PX.Api.Services.ScreenService.Submit(字符串id,IEnumerable
1 命令、SchemaMode SchemaMode、Boolean mobile、PXGraph&forceGraph、, 字符串和重定向ContainerView、字符串和重定向屏幕、字典
2
在PX.Api.Services.ScreenService.Submit(字符串id,
IEnumerable
1命令,SchemaMode SchemaMode)位于 PX.Api.Soap.Screen.ScreenGate.Submit(命令[]命令)

---内部异常堆栈跟踪的结束---

编辑

此订单类型已启用自动编号,代码如下所示。Acumatica版本6.00.1384

如前所述,此代码工作正常。突然行为改变了,我不知道原因是什么

    apitest.Screen context = BuisnessLogicACU.context;
                        SO301000Content SOSchema;

                        try
                        {
                            SOSchema = context.SO301000GetSchema();
                        }
                        catch
                        {
                            BuisnessLogicACU.contextLogin();
                            SOSchema = context.SO301000GetSchema();
                        }              
                        SOSchema.Actions.LSSOLineBinLotSerial.Commit = true;
                        SOSchema.Actions.CreateReceiptAction.Commit = true;

                        //HEADER INFO
                        AcumaticaInterface.apitest.Command[] commands = new AcumaticaInterface.apitest.Command[]
                    {
                        new Value
                        {
                            Value = returnInterfaceStatus.SalesOrderType,
                            LinkedCommand = SOSchema.OrderSummary.OrderType
                        },
                        SOSchema.Actions.Insert,

                        new Value 
                        {
                            Value = "false", 
                            LinkedCommand = SOSchema.OrderSummary.Hold
                        },
                        new Value 
                        {
                            Value = OrderStatus == POSOrderstatus.Normal ? (ConfigValues.POSNormalCustomerID ?? CustomerID) : CustomerID,  
                            LinkedCommand = SOSchema.OrderSummary.Customer
                        },
                        new Value 
                        {
                            Value = BizDate.HasValue ? ((DateTime)BizDate).ToLongDateString() : "", 
                            LinkedCommand = SOSchema.OrderSummary.Date
                        },
                        new Value 
                        {
                            Value = BizDate.HasValue ? ((DateTime)BizDate.Value).ToLongDateString() : "", 
                            LinkedCommand = SOSchema.OrderSummary.RequestedOn
                        },                   
                        new Value 
                        {
                            Value = POSID, 
                            LinkedCommand = SOSchema.OrderSummary.ExternalReference
                        },                
                        new Value 
                        {
                            Value = SIPosOrdrCreatedBy, 
                            LinkedCommand = SOSchema.OrderSummary.POSOrdrBy
                        },                
                        new Value 
                        {
                            Value = CustomerTaxZone, 
                            LinkedCommand = SOSchema.FinancialSettingsFinancialInformation.CustomerTaxZone
                        }
                    };

     AcumaticaInterface.apitest.Command[] commandline = new AcumaticaInterface.apitest.Command[]
                                {
                                 SOSchema.DocumentDetails.ServiceCommands.NewRow,
                                new Value 
                                {
                                    Value = line.InventoryID, 
                                    LinkedCommand = SOSchema.DocumentDetails.InventoryID 
                                },
                                new Value 
                                {
                                    Value = SIOutletCode, 
                                    LinkedCommand = SOSchema.DocumentDetails.Warehouse
                                },
                                new Value 
                                {
                                    Value = line.Quantity.ToString(), 
                                    LinkedCommand = SOSchema.DocumentDetails.Quantity,
                                    Commit = true
                                },                         
                                new Value 
                                {
                                    Value = line.UnitPrice.ToString(), 
                                    LinkedCommand = SOSchema.DocumentDetails.UnitPrice
                                },
                                new Value 
                                {
                                    Value = line.Uom, 
                                    LinkedCommand = SOSchema.DocumentDetails.UOM
                                },
                                new Value 
                                {
                                    Value = (line.DiscTotal ?? 0).ToString(), 
                                    LinkedCommand = SOSchema.DocumentDetails.DiscountAmount
                                },
                                  new Value 
                                {
                                    Value = (line.LineTotal ?? 0).ToString(), 
                                    LinkedCommand = SOSchema.DocumentDetails.ExtPrice
                                },
                                new Value 
                                {
                                    Value = line.DiscType ?? "", 
                                    LinkedCommand = SOSchema.DocumentDetails.POSDiscType
                                },
                                new Value 
                                {
                                    Value = line.LineType ?? "", 
                                    LinkedCommand = SOSchema.DocumentDetails.POSLineType
                                },
                                new Value 
                                {
                                    Value = line.VoucherSerial ?? "", 
                                    LinkedCommand = SOSchema.DocumentDetails.POSVoucherSerial
                                },
                                new Value 
                                {
                                    Value = line.PromoID ?? "", 
                                    LinkedCommand = SOSchema.DocumentDetails.POSPromoID
                                },
                                new Value 
                                {
                                    Value = line.PromoType ?? "", 
                                    LinkedCommand = SOSchema.DocumentDetails.POSPromoType
                                },
                                new Value 
                                {
                                    Value = (line.PromoPct ?? 0).ToString(), 
                                    LinkedCommand = SOSchema.DocumentDetails.POSPromoPct
                                },
                                new Value 
                                {
                                    Value = line.PromoBaseItem ?? "", 
                                    LinkedCommand = SOSchema.DocumentDetails.POSPromoBaseItem
                                },
                                //new Value 
                                //{
                                //    Value = SalesPerson, 
                                //    LinkedCommand = SOSchema.DocumentDetails.SalespersonID
                                //},
                                new Value 
                                {
                                    Value = line.Remarks ?? "", 
                                    LinkedCommand = SOSchema.DocumentDetails.NoteText,
                                    Commit = true 
                                },
                                 new Value 
                                {
                                    Value = POSID,
                                    LinkedCommand = SOSchema.DocumentDetails.PackUoM,
                                    Commit = true 
                                }
                            };
                            commands = commands.Concat(commandline).ToArray();

  AcumaticaInterface.apitest.Command[] save = new AcumaticaInterface.apitest.Command[] {
                        SOSchema.Actions.Save                       
                    };
                    commands = commands.Concat(save).ToArray();
  AcumaticaInterface.apitest.Command[] returnResult= new AcumaticaInterface.apitest.Command[] {                 
                SOSchema.OrderSummary.OrderType,
                SOSchema.OrderSummary.OrderNbr,
                SOSchema.OrderSummary.Status
            };
                commands = commands.Concat(returnResult).ToArray();

                var SOrder = context.SO301000Submit(commands)[0];

到目前为止,我已经多次看到此错误消息,通常是由于一组错误的API命令导致更新现有的转移订单,而不是创建新的转移订单

如果为TR订单类型的编号顺序启用了自动编号,请确保在将OrderType设置为TR后通过
Insert
操作:

Screen context = new Screen();
context.CookieContainer = new System.Net.CookieContainer();
context.Url = "http://localhost/StackOverflow/Soap/SO301000.asmx";
context.Login(username, password);
try
{
    Content salesOrderSchema = PX.Soap.Helper.GetSchema<Content>(context);
    var commands = new Command[]
    {
        new Value
        {
            LinkedCommand = salesOrderSchema.OrderSummary.OrderType,
            Value = "TR"
        },
        salesOrderSchema.Actions.Insert,
        new Value
        {
            LinkedCommand = salesOrderSchema.OrderSummary.DestinationWarehouse,
            Value = "RETAIL"
        },
        salesOrderSchema.Actions.Save,
        salesOrderSchema.OrderSummary.OrderNbr
    };
    var transferOrder = context.Submit(commands);
}
finally
{
    context.Logout();
}
下面是我能够在全新的6.00.1384网站上运行的最接近的SOAP命令集,只部署了销售演示并且它运行时没有任何问题。不确定如何在本地计算机上复制报告的问题,而无需您执行确切的步骤

Screen context = new Screen();
context.CookieContainer = new System.Net.CookieContainer();
context.Url = "http://localhost/SOReturn/Soap/SO301000.asmx";
context.Login(Login, Password);

var SOSchema = context.GetSchema();

SOSchema.Actions.LSSOLineBinLotSerial.Commit = true;
SOSchema.Actions.CreateReceiptAction.Commit = true;

//HEADER INFO
var headerCommands = new Command[]
{
    new Value
    {
        Value = "RC",
        LinkedCommand = SOSchema.OrderSummary.OrderType
    },
    SOSchema.Actions.Insert,

    new Value
    {
        Value = "false",
        LinkedCommand = SOSchema.OrderSummary.Hold
    },
    new Value
    {
        Value = "ABARTENDE",
        LinkedCommand = SOSchema.OrderSummary.Customer
    },
    //new Value
    //{
    //    Value = BizDate.HasValue ? ((DateTime)BizDate).ToLongDateString() : "",
    //    LinkedCommand = SOSchema.OrderSummary.Date
    //},
    //new Value
    //{
    //    Value = BizDate.HasValue ? ((DateTime)BizDate.Value).ToLongDateString() : "",
    //    LinkedCommand = SOSchema.OrderSummary.RequestedOn
    //},
    new Value
    {
        Value = "TEST",
        LinkedCommand = SOSchema.OrderSummary.ExternalReference
    },
    //new Value
    //{
    //    Value = SIPosOrdrCreatedBy,
    //    LinkedCommand = SOSchema.OrderSummary.POSOrdrBy
    //},
    //new Value
    //{
    //    Value = CustomerTaxZone,
    //    LinkedCommand = SOSchema.FinancialSettingsFinancialInformation.CustomerTaxZone
    //}
};

var commandline = new Command[]
{
    SOSchema.DocumentDetails.ServiceCommands.NewRow,

    new Value
    {
        Value = "AACOMPUT01",
        LinkedCommand = SOSchema.DocumentDetails.InventoryID
    },
    new Value
    {
        Value = "WHOLESALE",
        LinkedCommand = SOSchema.DocumentDetails.Warehouse
    },
    new Value
    {
        Value = "10.0",
        LinkedCommand = SOSchema.DocumentDetails.Quantity,
        Commit = true
    },
    new Value
    {
        Value = "234.01",
        LinkedCommand = SOSchema.DocumentDetails.UnitPrice
    },
    new Value
    {
        Value = "EA",
        LinkedCommand = SOSchema.DocumentDetails.UOM
    },
    new Value
    {
        Value = "50.0",
        LinkedCommand = SOSchema.DocumentDetails.DiscountAmount
    },
    new Value
    {
        Value = "4500.00",
        LinkedCommand = SOSchema.DocumentDetails.ExtPrice,
        Commit = true
    },
    //new Value
    //{
    //    Value = line.DiscType ?? "",
    //    LinkedCommand = SOSchema.DocumentDetails.POSDiscType
    //},
    //new Value
    //{
    //    Value = line.LineType ?? "",
    //    LinkedCommand = SOSchema.DocumentDetails.POSLineType
    //},
    //new Value
    //{
    //    Value = line.VoucherSerial ?? "",
    //    LinkedCommand = SOSchema.DocumentDetails.POSVoucherSerial
    //},
    //new Value
    //{
    //    Value = line.PromoID ?? "",
    //    LinkedCommand = SOSchema.DocumentDetails.POSPromoID
    //},
    //new Value
    //{
    //    Value = line.PromoType ?? "",
    //    LinkedCommand = SOSchema.DocumentDetails.POSPromoType
    //},
    //new Value
    //{
    //    Value = (line.PromoPct ?? 0).ToString(),
    //    LinkedCommand = SOSchema.DocumentDetails.POSPromoPct
    //},
    //new Value
    //{
    //    Value = line.PromoBaseItem ?? "",
    //    LinkedCommand = SOSchema.DocumentDetails.POSPromoBaseItem
    //},
    new Value
    {
        Value = "Remarks",
        LinkedCommand = SOSchema.DocumentDetails.NoteText,
        Commit = true
    },
    //new Value
    //{
    //    Value = POSID,
    //    LinkedCommand = SOSchema.DocumentDetails.PackUoM,
    //    Commit = true
    //}
};

var commands = headerCommands.Concat(commandline).ToArray();

Command[] save = new Command[] 
{
    SOSchema.Actions.Save
};
commands = commands.Concat(save).ToArray();
Command[] returnResult = new Command[] 
{
    SOSchema.OrderSummary.OrderType,
    SOSchema.OrderSummary.OrderNbr,
    SOSchema.OrderSummary.Status
};
commands = commands.Concat(returnResult).ToArray();

var SOrder = context.Submit(commands)[0];

你能提供Acumatica版本和你在屏幕API调用中使用的命令吗?你能提供你的代码吗?如果您可以创建最少的代码来重现您的问题,那就太好了。请参阅更新的问题。有什么帮助吗?在我下面更新的答案中,是最接近的SOAP命令集,可以在全新的6.00.1384网站上运行,并且只部署了销售演示。它运行时没有任何问题。不知道在没有您的精确步骤的情况下如何在本地计算机上复制报告的问题。您好,我已经检查并启用了自动编号,我还有insert命令。请检查更新的问题。谢谢你的回复。
Screen context = new Screen();
context.CookieContainer = new System.Net.CookieContainer();
context.Url = "http://localhost/SOReturn/Soap/SO301000.asmx";
context.Login(Login, Password);

var SOSchema = context.GetSchema();

SOSchema.Actions.LSSOLineBinLotSerial.Commit = true;
SOSchema.Actions.CreateReceiptAction.Commit = true;

//HEADER INFO
var headerCommands = new Command[]
{
    new Value
    {
        Value = "RC",
        LinkedCommand = SOSchema.OrderSummary.OrderType
    },
    SOSchema.Actions.Insert,

    new Value
    {
        Value = "false",
        LinkedCommand = SOSchema.OrderSummary.Hold
    },
    new Value
    {
        Value = "ABARTENDE",
        LinkedCommand = SOSchema.OrderSummary.Customer
    },
    //new Value
    //{
    //    Value = BizDate.HasValue ? ((DateTime)BizDate).ToLongDateString() : "",
    //    LinkedCommand = SOSchema.OrderSummary.Date
    //},
    //new Value
    //{
    //    Value = BizDate.HasValue ? ((DateTime)BizDate.Value).ToLongDateString() : "",
    //    LinkedCommand = SOSchema.OrderSummary.RequestedOn
    //},
    new Value
    {
        Value = "TEST",
        LinkedCommand = SOSchema.OrderSummary.ExternalReference
    },
    //new Value
    //{
    //    Value = SIPosOrdrCreatedBy,
    //    LinkedCommand = SOSchema.OrderSummary.POSOrdrBy
    //},
    //new Value
    //{
    //    Value = CustomerTaxZone,
    //    LinkedCommand = SOSchema.FinancialSettingsFinancialInformation.CustomerTaxZone
    //}
};

var commandline = new Command[]
{
    SOSchema.DocumentDetails.ServiceCommands.NewRow,

    new Value
    {
        Value = "AACOMPUT01",
        LinkedCommand = SOSchema.DocumentDetails.InventoryID
    },
    new Value
    {
        Value = "WHOLESALE",
        LinkedCommand = SOSchema.DocumentDetails.Warehouse
    },
    new Value
    {
        Value = "10.0",
        LinkedCommand = SOSchema.DocumentDetails.Quantity,
        Commit = true
    },
    new Value
    {
        Value = "234.01",
        LinkedCommand = SOSchema.DocumentDetails.UnitPrice
    },
    new Value
    {
        Value = "EA",
        LinkedCommand = SOSchema.DocumentDetails.UOM
    },
    new Value
    {
        Value = "50.0",
        LinkedCommand = SOSchema.DocumentDetails.DiscountAmount
    },
    new Value
    {
        Value = "4500.00",
        LinkedCommand = SOSchema.DocumentDetails.ExtPrice,
        Commit = true
    },
    //new Value
    //{
    //    Value = line.DiscType ?? "",
    //    LinkedCommand = SOSchema.DocumentDetails.POSDiscType
    //},
    //new Value
    //{
    //    Value = line.LineType ?? "",
    //    LinkedCommand = SOSchema.DocumentDetails.POSLineType
    //},
    //new Value
    //{
    //    Value = line.VoucherSerial ?? "",
    //    LinkedCommand = SOSchema.DocumentDetails.POSVoucherSerial
    //},
    //new Value
    //{
    //    Value = line.PromoID ?? "",
    //    LinkedCommand = SOSchema.DocumentDetails.POSPromoID
    //},
    //new Value
    //{
    //    Value = line.PromoType ?? "",
    //    LinkedCommand = SOSchema.DocumentDetails.POSPromoType
    //},
    //new Value
    //{
    //    Value = (line.PromoPct ?? 0).ToString(),
    //    LinkedCommand = SOSchema.DocumentDetails.POSPromoPct
    //},
    //new Value
    //{
    //    Value = line.PromoBaseItem ?? "",
    //    LinkedCommand = SOSchema.DocumentDetails.POSPromoBaseItem
    //},
    new Value
    {
        Value = "Remarks",
        LinkedCommand = SOSchema.DocumentDetails.NoteText,
        Commit = true
    },
    //new Value
    //{
    //    Value = POSID,
    //    LinkedCommand = SOSchema.DocumentDetails.PackUoM,
    //    Commit = true
    //}
};

var commands = headerCommands.Concat(commandline).ToArray();

Command[] save = new Command[] 
{
    SOSchema.Actions.Save
};
commands = commands.Concat(save).ToArray();
Command[] returnResult = new Command[] 
{
    SOSchema.OrderSummary.OrderType,
    SOSchema.OrderSummary.OrderNbr,
    SOSchema.OrderSummary.Status
};
commands = commands.Concat(returnResult).ToArray();

var SOrder = context.Submit(commands)[0];