Error: Acumatica SOAP API release invoice from Invoices and Memos screen(AR301000)
Error: Acumatica SOAP API release invoice from Invoices and Memos screen(AR301000)
我正在尝试使用 SOAP API 从发票和备忘录屏幕 (AR301000) 开具特定发票,如 I210 基于合同的 Web 服务指南中所述。
调试我的代码,当我发布特定发票时出现此错误:
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();
调用行出现错误。
首先您需要确保您的发票未被搁置 - 如果它处于搁置状态,则 Get 返回的实体将为空。这可能是个问题。
此外,您能否尝试在调用中使用 ReleaseInvoice() 而不是 Release()?
InvokeResult invokeResult = client.Invoke(发票, new ReleaseInvoice());
过去对我有用。
我正在尝试使用 SOAP API 从发票和备忘录屏幕 (AR301000) 开具特定发票,如 I210 基于合同的 Web 服务指南中所述。
调试我的代码,当我发布特定发票时出现此错误:
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();
调用行出现错误。
首先您需要确保您的发票未被搁置 - 如果它处于搁置状态,则 Get 返回的实体将为空。这可能是个问题。
此外,您能否尝试在调用中使用 ReleaseInvoice() 而不是 Release()?
InvokeResult invokeResult = client.Invoke(发票, new ReleaseInvoice());
过去对我有用。