首页 > 解决方案 > 错误:发票和备忘录屏幕中的 Acumatica SOAP API 发行发票 (AR301000)

问题描述

我正在尝试使用 I210 基于合同的 Web 服务指南中记录的 SOAP API 从发票和备忘录屏幕 (AR301000) 发布特定发票。

调试我的代码,当我发布特定发票时,我收到此错误:

System.ServiceModel.FaultException: 'PX.Data.PXInvalidOperationException: Operation failed ---> System.Data.SqlClient.SqlException: The multi-part identifier "LocationExtAddress.LocationBAccountID" could not be bound.
The multi-part identifier "LocationExtAddress.LocationCD" could not be bound.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)... and more error code

这是我的代码:

//successful login

//Invoice data
string invoiceType = "Invoice";
string invoiceNbr = "SS-00000009";

//Find the invoice to be released
ARInvoice invoiceToFind = new ARInvoice
{
    Type = new StringSearch { Value = invoiceType },
    ReferenceNbr = new StringSearch { Value = invoiceNbr },
    Hold = new BooleanValue { Value = false }
};
ARInvoice invoice = (ARInvoice) client.Get(invoiceToFind);

//Release invoice
InvokeResult invokeResult = client.Invoke(invoice, new Release());

//Monitor the status of the process
ProcessResult processResult = LongRunProcessor.GetProcessResult(client, invokeResult);

//Get the confirmed shipment
invoice = (ARInvoice)client.Get(new ARInvoice { ID = processResult.EntityId });

//Display the summary of the invoice
txtType.Text = invoice.Type.Value;
txtNumber.Text = invoice.ReferenceNbr.Value;
txtStatus.Text = invoice.Status.Value;

client.Logout();

错误发生在 Invoke 行。

标签: acumaticaacumatica-kb

解决方案


您需要确保您的发票没有被搁置的第一件事 - 如果它被搁置,则 Get 返回的实体将为空。那可能是个问题。

另外,您能否尝试在调用中使用 ReleaseInvoice() 而不是 Release()?

InvokeResult invokeResult = client.Invoke(invoice, new ReleaseInvoice());

这在过去对我有用。


推荐阅读