Skip to main content
Question

VendorLocation endpoint does not exist - need help creating one.

  • January 10, 2025
  • 4 replies
  • 44 views

pjames
Jr Varsity II
Forum|alt.badge.img

Hello!

 

While developing a customization project to extend a webservice to migrate data from our legacy ERP into Acumatica, I have discovered that while there is a standard ‘CustomerLocation’ object where we can access and modify customer location entries, there is no equivalent VendorLocation object.

 

I tried to create a VendorLocation endpoint by mimicking how the Customer Location fields were all mapped, but there do not appear to be equivalent mappings in order for me to accomplish this.

 

Additionally, if I just select all fields from the Vendor Location Summary, it corrupts things so badly that we start getting stack overflows when trying to push a Sales Order into Acumatica:


And when we try to pull the VendorLocation data via Postman, it would throw errors relating to the Address information we had mapped directly from the Vendor Location Summary (here’s a small snip of that error):

"message": "An error has occurred.",

    "exceptionMessage": "The multi-part identifier \"BAccountID!Address.City\" could not be bound.\r\nThe multi-part identifier \"BAccountID!Address.CountryID\" could not be bound.\r\nThe multi-part identifier \"BAccountID!Address.PostalCode\" could not be bound.",



It took me at least a week to unpublish and republish my project multiple times in order to get the Sales Order object able to receive PUT requests successfully again (without my VendorLocation endpoint in it).

 

Is Acumatica planning on creating a stock VendorLocation object any time soon?  If not, can anyone help with the mappings I need to make so that we do not run into the same issues above?

Any help would be greatly appreciated!

4 replies

Nilkanth Dipak
Semi-Pro I
Forum|alt.badge.img+10

Hi ​@pjames,

I extended the Default Endpoint and Created new Endpoint named vendor Location and added required fields to that entity from vendor Location Summary  and from Location Address, 

I am able to fetch the Vendor locations data in Postman as well.

Extended Endpoint for Vendor Location

 

Postman Result

 

Hope, it helps!


pjames
Jr Varsity II
Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • 14 replies
  • January 13, 2025

Thanks!

Can you tell me which screen you based the object off of?

On my side, I have two choices when I enter Vendor Location into the Screen name while creating the top level object:

Vendor Locations - AP.30.30.P1 (no workspace or category)
Vendor Locations - AP.30.30.10 (Workspace: Payables, Category: Profiles)

I selected AP.30.30.10 and added all the fields exactly like your screenshot, but I still get the “could not be bound” errors when attempting to pull the vendor locations via PostMan:

 

{
    "message": "An error has occurred.",
    "exceptionMessage": "The multi-part identifier \"BAccountID!Address.AddressLine1\" could not be bound.\r\nThe multi-part identifier \"BAccountID!Address.AddressLine2\" could not be bound.\r\nThe multi-part identifier \"BAccountID!Address.City\" could not be bound.\r\nThe multi-part identifier \"BAccountID!Address.CountryID\" could not be bound.",
    "exceptionType": "Microsoft.Data.SqlClient.SqlException",
    "stackTrace": "   at Microsoft.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__210_0(Task`1 result)\r\n   at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()\r\n   at System.Threading.Tasks.Task.Execute()\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 PX.Data.PXSqlDatabaseProvider.<ExecuteReaderInternalAsync>d__22.MoveNext() in C:\\build\\code_repo\\NetTools\\PX.Data\\Database\\MsSql\\MsSqlDatabaseProvider.cs:line 410\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 PX.Data.PXSelectAsyncResult.PXSelectResultAsyncEnumerator.<MoveNextAsync>d__6.MoveNext() in C:\\build\\code_repo\\NetTools\\PX.Data\\Database\\PXSelectAsyncResult.cs:line 75\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at PX.Common.Extensions.AsyncEnumerableExtensions.<OnCurrentSynchronizationContext>d__0`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 PX.Common.Extensions.AsyncEnumerableExtensions.<OnCurrentSynchronizationContext>d__0`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.Threading.Tasks.Sources.ManualResetValueTaskSourceCore`1.GetResult(Int16 token)\r\n   at System.Linq.AsyncEnumerable.SelectEnumerableAsyncIterator`2.<MoveNextCore>d__7.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.Linq.AsyncIteratorBase`1.<MoveNextAsync>d__8.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.Linq.AsyncIteratorBase`1.<MoveNextAsync>d__8.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.Linq.AsyncEnumerableEx.<<Using>g__Core|121_0>d`2.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.Linq.AsyncEnumerableEx.<<Using>g__Core|121_0>d`2.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.Threading.Tasks.Sources.ManualResetValueTaskSourceCore`1.GetResult(Int16 token)\r\n   at PX.Common.Extensions.AsyncEnumerableExtensions.<OnCurrentSynchronizationContext>d__0`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 PX.Common.Extensions.AsyncEnumerableExtensions.<OnCurrentSynchronizationContext>d__0`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.Threading.Tasks.Sources.ManualResetValueTaskSourceCore`1.GetResult(Int16 token)\r\n   at System.Linq.AsyncEnumerable.WhereSelectEnumerableAsyncIterator`2.<MoveNextCore>d__8.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.Linq.AsyncIteratorBase`1.<MoveNextAsync>d__8.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.Linq.AsyncIteratorBase`1.<MoveNextAsync>d__8.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 PX.Common.Extensions.AsyncEnumerableExtensions.<OnCurrentSynchronizationContext>d__0`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 PX.Common.Extensions.AsyncEnumerableExtensions.<OnCurrentSynchronizationContext>d__0`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.Threading.Tasks.Sources.ManualResetValueTaskSourceCore`1.GetResult(Int16 token)\r\n   at System.Linq.AsyncEnumerable.<<ToListAsync>g__Core|620_0>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.Linq.AsyncEnumerable.<<ToListAsync>g__Core|620_0>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 PX.Api.ContractBased.EntityService.<GetListOptimizedAsyncFromEnumerable>d__13.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 PX.Api.ContractBased.EntityService.<GetListAsyncFromEnumerable>d__9.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 PX.Api.ContractBased.WebApi.Controllers.EntityController.<GetList>d__14.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 lambda_method(Closure , Object )\r\n   at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.AwaitableObjectResultExecutor.<Execute>d__0.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 Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeActionMethodAsync>d__12.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 Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeNextActionFilterAsync>d__10.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 Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)\r\n   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeInnerFilterAsync>d__13.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 Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeNextExceptionFilterAsync>d__24.MoveNext()"
}

I should note - we do have a customization project that has updated the AP 30.30.10 screen, but this was done by a consulting firm and it appears to have added 4 fields from PX.Objects.CR.Contact (FaxType, Phone1Type, Phone2Type and Phone3Type).


Forum|alt.badge.img+6
  • Captain II
  • 570 replies
  • January 16, 2025

The Vendor Locations screen is what I would guess: AP303010. The PL will just be a GI.

However - one thing to keep in mind is that in cases like this and you only need to share Vendor Location data, not update it, you can make a GI that can be accessed through the REST api which might be easier.

But if you need to update, then that won’t work.

I looked at the CustomerLocation endpoint and noticed that the Address fields are under the Contact record. Given that both Customer and Vendor should be using the same tables, you should be able to copy the CustomerLocation end point as closely as you can.


Nilkanth Dipak
Semi-Pro I
Forum|alt.badge.img+10

Hi ​@pjames,

Could you please post your web service endpoints screens screenshot to review?


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings