I'm getting an error when I try to release an Invoice from Invoices and Memos screen (AR301000). The invoice is ready to be released, I even release the invoice manually and don't get any error.
This is the error:
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)
This is my code in VS:
using (DefaultSoapClient client = new DefaultSoapClient())
{
//Login part
//Invoice data
string invoiceType = "Invoice";
string invoiceNbr = "T3-00000018";
//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 ReleaseARInvoice());
//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();
}
Specifically I get that error in "client.Invoke".
question from:
https://stackoverflow.com/questions/65942902/getting-error-when-i-try-to-release-an-invoice-via-api 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…