The program creates a Bill in Acumatica using SOAP. The Endpoint was extended to include InventoryID, WSDL generated. The program uses the extended Endpoint to read and write all info. Reading InventoryID on non-Stock items works fine.
Populating Bill Details with the fields other than InventoryID also works fine:
loBillDetails[lnCurIndex + I1] = new BillDetail
{
// InventoryID = new StringValue { Value = lcInventoryID },
Branch = new StringValue { Value = lcBranch },
Amount = new DecimalValue { Value = lnLineExtAmt },
ExtendedCost = new DecimalValue { Value = lnLineExtAmt },
UnitCost = new DecimalValue { Value = 0 },
Qty = new DecimalValue { Value = 0 },
TransactionDescription = new StringValue { Value = lcTranDesc },
UOM = new StringValue { Value = lcUOM },
Account = new StringValue { Value = lcAccount },
Subaccount = new StringValue { Value = lcSubAccount },
Description = new StringValue { Value = lcItemDesc },
};
However, including InventoryID causes the Bill insert to fail, with an error message below. I checked that the value provided to InventoryID is correct.
Do I need to provide any additional fields to the Bill that I am inserting? What might be the issue here?
PX.Data.PXInvalidOperationException: Operation failed ---> PX.Data.PXBadDictinaryException: The key cannot be updated at this time. Try to save your previous changes first.\n at PX.Data.PXCache1.Update(IDictionary keys, IDictionary values)\n at PX.Data.PXGraph.ExecuteUpdate(String viewName, IDictionary keys, IDictionary values, Object[] parameters)\n at PX.Data.PXGraph.CopyPasteCommitChanges(String viewName, OrderedDictionary keys, OrderedDictionary vals)\n at PX.Api.SyImportProcessor.SyStep.a(Object A_0, PXFilterRow[] A_1, PXFilterRow[] A_2)\n at PX.Api.SyImportProcessor.ExportTableHelper.ExportTable()\n --- End of inner exception stack trace ---\n at PX.Api.ContractBased.Soap.WebApiSoapController.Post(ISoapSystemContract systemContract, XmlReader requestReader, String serviceNamespace, String internalNamespace, MethodInfo method, Func
1 serviceFactory, IEdmModel edmModel)\n at PX.Api.ContractBased.Soap.WebApiSoapController.d__8.MoveNext()\n--- End of stack trace from previous location
where exception was thrown ---\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n at PX.Api.ContractBased.Soap.WebApiSoapController.d__6.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n at System.Threading.Tasks.TaskHelpersExtensions.d__3`1.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n at System.Web.Http.Controllers.ApiControllerActionInvoker.d__0.MoveNext()\n--- End of stack trace from previous location where except
ion was thrown ---\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n at System.Web.Http.Controllers.ActionFilterResult.d__2.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n at System.Web.Http.Controllers.ExceptionFilterResult.d__0.MoveNext()"
Exception thrown: 'System.ServiceModel.FaultException' in mscorlib.dll
Thank you. Alexander