Solved

Missing Fields When Calling PutEntity

  • 13 April 2022
  • 4 replies
  • 152 views

Hi Everyone,

 

I am testing our customization project that integrates with our WMS system. We have two Acumatica instances set up on the latest 2022 R1 release. We are using one for development and the other to simulate production. I have tested everything in the development instance and everything is working as expected.

 

After verifying transaction downloads and uploads were working correctly, I exported the customization project and imported it into the “production” instance. I am running into issues uploading transactions to the production instance, receiving errors that fields cannot be empty when calling PutEntity().

 

Issues and Receipts are specifying that PostPeriod and Branch cannot be empty when calling PutEntity().

Sales Orders specify that BaseCurrencyID and CuryID cannot be empty when calling PutEntity().

 

We had fixed the PostPeriod and Branch errors in the development instance, but we are getting this error in the production instance, even though we set these fields when updating the object from the integration. Sales Order uploads are working just fine in the development instance, but are throwing errors in the production instance.

 

I am not sure what could be causing these problems. The customization projects are the same between instances and the integration uses the same code between instances. Does anything stick out here? Thank you!

 

To note, we are using the REST API.

 

Error calling PutEntity  {    "message": "An error has occurred.",    "exceptionMessage": "Issue.PostPeriod: The financial period cannot be specified because the branch has not been specified in the Branch box
Inserting 'Receipt' record raised at least one error. Please review the errors
BranchID: 'Branch' cannot be empty.", "exceptionType": "PX.Api.ContractBased.OutcomeEntityHasErrorsException", "stackTrace": " at PX.Api.ContractBased.EntityService.GetOperationResult(EntityImpl entity, EntityExportContextBuilder entityExportContextBuilder, PXSYTable exportedKeys, PXOuterException contextError, Boolean throwOnError, Boolean addCancelCommand)\
at PX.Api.ContractBased.EntityService.Put(ISystemContract systemContract, String version, String name, EntityImpl entity, CbOperationContext operationContext, Boolean throwOnError)\
at PX.Api.ContractBased.Soap.SoapFacadeBase.PutImpl(EntityImpl entity, Boolean throwOnValidationError)\
at PX.Api.ContractBased.SystemContracts.V2.RestController.PutEntity(EntityImpl entity, String select, String filter, String expand, String custom)\
at lambda_method(Closure , Object , Object[] )\
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_2.<GetExecutor>b__2(Object instance, Object[] methodParameters)\
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\

 

icon

Best answer by Dmitrii Naumov 13 April 2022, 17:15

View original

4 replies

Userlevel 7
Badge +5

Do you specify the Branch value when you log in? 

I think the root cause here is missing default values for Branch related fields 

No, the Branch value isn’t specified when logging in. I will test out a transaction with the Branch specified and get back to you. Thank you for the reply!

Userlevel 7
Badge +11

Hi @noahmiller02 

Please check with the same data on the screen as well. If any issues on the screen also we may get errors like this.
 

Hi Dmitrii, specifying the Branch value when logging in worked perfectly for the Branch related fields. Thank you!

Jinin, I double checked the screens to see if the same errors occurred, but had no luck reproducing any.

Issues and Receipts are working correctly now. I’m working through a new error with Sales Orders. A cast on the ‘Last Modified On’ field is causing an error. Specifying this field when uploading results in another error stating that “No Sales Order line could be found”.

Thank you both for the help!

Error calling PutEntity
{
"message": "An error has occurred.",
"exceptionMessage": "An error occurred during processing of the field Last Modified On: Specified cast is not valid..",
"exceptionType": "PX.Data.PXException",
"stackTrace": " at PX.Data.PXCache.OnRowSelecting(Object item, PXDataRecord record, Int32& position, Boolean isReadOnly)\r\n at PX.Data.PXCache`1.Select(PXDataRecord record, Int32& position, Boolean isReadOnly, Boolean& wasUpdated)\r\n at PX.Data.PXView.CreateResult(PXCache[] caches, PXDataRecord rec, Boolean hascount, Boolean& overrideSort, Boolean& extFilter)\r\n at PX.Data.PXView.GetResult(Object[] parameters, PXFilterRow[] filters, Boolean reverseOrder, Int32 topCount, PXSearchColumn[] sorts, Boolean& overrideSort, Boolean& extFilter)\r\n at PX.Data.PXView.Select(Object[] currents, Object[] parameters, Object[] searches, String[] sortcolumns, Boolean[] descendings, PXFilterRow[] filters, Int32& startRow, Int32 maximumRows, Int32& totalRows)\r\n at PX.Data.PXGraph.ExecuteSelect(String viewName, Object[] currents, Object[] parameters, Object[] searches, String[] sortcolumns, Boolean[] descendings, PXFilterRow[] filters, Int32& startRow, Int32 maximumRows, Int32& totalRows)\r\n at PX.Data.PXGraph.ExecuteSelect(String viewName, Object[] parameters, Object[] searches, String[] sortcolumns, Boolean[] descendings, PXFilterRow[] filters, Int32& startRow, Int32 maximumRows, Int32& totalRows)\r\n at PX.Api.SyImportProcessor.SyStep.SelectRows(String viewName, PXFilterRow[] filters, Int32 topCount, Boolean bypassInserted, Int32 startRow, SyExportContext exportContext)\r\n at PX.Api.SyImportProcessor.ExportTableHelper.EnsurePrimaryViewRow(PXFilterRow[] filters, Int32 startRow)\r\n at PX.Api.SyImportProcessor.ExportTableHelper.ExportTable()\r\n at PX.Api.ContractBased.EntityService.GetOperationResult(EntityImpl entity, EntityExportContextBuilder entityExportContextBuilder, PXSYTable exportedKeys, PXOuterException contextError, Boolean throwOnError, Boolean addCancelCommand)\r\n at PX.Api.ContractBased.EntityService.Put(ISystemContract systemContract, String version, String name, EntityImpl entity, CbOperationContext operationContext, Boolean throwOnError)\r\n at PX.Api.ContractBased.Soap.SoapFacadeBase.PutImpl(EntityImpl entity, Boolean throwOnValidationError)\r\n at PX.Api.ContractBased.SystemContracts.V2.RestController.PutEntity(EntityImpl entity, String select, String filter, String expand, String custom)\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_2.<GetExecutor>b__2(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__15.MoveNext()",
"innerException": {
"message": "An error has occurred.",
"exceptionMessage": "Specified cast is not valid.",
"exceptionType": "System.InvalidCastException",
"stackTrace": " at System.Data.SqlClient.SqlBuffer.get_DateTime()\r\n at System.Data.SqlClient.SqlDataReader.GetDateTime(Int32 i)\r\n at PX.Data.PXDataRecord.GetDateTime(Int32 i)\r\n at PX.Data.PXDBDateAttribute.RowSelecting(PXCache sender, PXRowSelectingEventArgs e)\r\n at PX.Data.PXCache.OnRowSelecting(Object item, PXDataRecord record, Int32& position, Boolean isReadOnly)"
}
}

 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved