acumatica - 错误:发票和备忘录屏幕中的 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 行。
解决方案
您需要确保您的发票没有被搁置的第一件事 - 如果它被搁置,则 Get 返回的实体将为空。那可能是个问题。
另外,您能否尝试在调用中使用 ReleaseInvoice() 而不是 Release()?
InvokeResult invokeResult = client.Invoke(invoice, new ReleaseInvoice());
这在过去对我有用。
推荐阅读
- c++ - heap out of memory, noscript_shared_function_infos 持有的所有保留内存
- python - 根据文件名列表和目录列表将文件复制到新位置,但保留目录结构
- symfony4 - Symfony 4 / FosREST:API 路由返回 404 但不是 web 路由
- python - 如何计算熊猫列中带有日期时间的日期的剩余月份?
- c++ - 如何从http响应中删除垃圾数据
- .net - 如何修复应用服务的 Azure 部署槽问题?
- angular - 如何获取以前的搜索结果?
- asp.net-core - Razor Pages ASP.NET 不显眼的 ajax 发布部分更新
- php - 如何转换 1.5xxE-5
- javascript - ng-model 绑定没有正确更新