当通过Acumatica服务创建时,我正在体验下面的错误。下面是错误和示例编码。
PX.Data.PXException: Error #289: The button Save is disabled.
SO301000Content soSchema = context.SO301000GetSchema();
var commands = new List<Acumatica_LSOne_Integration.SALES.Command>();
commands.Add(new Acumatica_LSOne_Integration.SALES.Value
{Value = vType, LinkedCommand = soSchema.OrderSummary.OrderType});
commands.Add(new Acumatica_LSOne_Integration.SALES.Value
{Value = vCustomer, LinkedCommand = soSchema.OrderSummary.Customer});
commands.Add(new Acumatica_LSOne_Integration.SALES.Value
{Value = TransDate.ToLongTimeString(), LinkedCommand = soSchema.OrderSummary.Date});
commands.Add(new Acumatica_LSOne_Integration.SALES.Value
{Value = TransDate.ToLongTimeString(), LinkedCommand = soSchema.OrderSummary.RequestedOn});
commands.Add(new Acumatica_LSOne_Integration.SALES.Value
{Value = "X",LinkedCommand = soSchema.OrderSummary.Project});
commands.Add(new Acumatica_LSOne_Integration.SALES.Value
{Value = APaymentMethod,LinkedCommand = soSchema.PaymentSettings.PaymentMethod});
commands.Add(new Acumatica_LSOne_Integration.SALES.Value
{Value = "FROM LSOne TransactionID: " + vRecordID + " ReceiptID: " + vReceiptID,LinkedCommand = soSchema.OrderSummary.Description});
commands.Add(soSchema.Actions.Save);
commands.Add(soSchema.OrderSummary.OrderNbr);
context.SO301000Submit(commands.ToArray());发布于 2015-05-29 08:55:41
出现此问题是因为您正在设置关键字段之一OrderType,而没有指示要添加记录。当从用户界面执行此操作时,系统会将屏幕放在记录上,但在通过web服务调用时,这种情况似乎不会自动发生。
您可以在设置soSchema.Actions.Insert之后添加OrderType,也可以传入虚拟OrderNbr,如:new SO301000.Value { Value = "<NEW>", LinkedCommand = soSchema.OrderSummary.OrderNbr }
最后,一个警告词--您在没有指定区域性的情况下使用ToLongTimeString()转换ToLongTimeString()字段。如果客户端计算机具有与Acumatica服务器不同的区域设置,则可能会出现错误。我建议您改用TransDate.ToString(System.Globalization.CultureInfo.InvariantCulture)。
发布于 2015-06-02 03:08:27
您是在尝试一次创建一个订单吗?或者你有多个线程来做这件事?
无论如何,试着添加
context.SO301000Clear();
SO301000Content soSchema = context.SO301000GetSchema();你可以加上加百列提到..。
SOSchema.Actions.Insert在设置OrderType之后。看看这对你有没有帮助。
https://stackoverflow.com/questions/30520942
复制相似问题