How to change default location of the customer through API
Hello Everyone,
We are creating customer and customer locations in acumatica through REST API and these APIs are working fine.
But many of the customers has default location as a MAIN in acumatica and we want to change this default lcoation to other through customer or customer location API.
I have extended the customer end point and added “SET AS Default” Action to the API but this is not giving the correct result. We are not able to change the default location of the customer through API.
What changes are required in customer or customer location API, to make the required location as default instead of MAIN. Can anyone suggest the solution or any work around for this.
Thanks in advance.
Page 1 / 1
Hi @ssamboju12 To set the default location through REST API we need to perform the below steps.
Please find the details below.
To work with set default location, as a first step we need to fetch the Customer Location Details (Customer Location ID) by doing a Get Call by Customer ID .
Similarly, we can achieve this by using below steps as well.
1) Extend the default endpoint add the fields as below in the screenshot for the CustomerLocation and Customer entity
2. Get the LocationID2 of the Customer Location that you wanted to Default
3. Use the ID in the put request to update the default location for the customer
@ssamboju12 Awesome. Thanks a lot for sharing the another solution to achieve this requirement.
Hello guys, I would like to ask a question on this discussion because I was indeed asking myself the same question, and following your answers. I tried to apply your recommendations but I encounter a problem that I can't explain: when I use for example the following POST method
whatever ID I use to determine which address I want to apply the True value to, it’s automatically applied to the first row in the grid. have tried to apply other parameters in my condition to be more precise but the change is always applied to the first row of the existing addresses.
Have you ever encountered this kind of case, and if so, is there a way to achieve the desired result?
Thanks in advance for your help on this subject.
Hi @mbrunerie43 you may want to post this as a new question referencing this post if you don’t get response. Thanks!
Hello @mbrunerie43
I have also faced the same issue like you. When I tried to update the location from API, it is always assigned to first row of the grid.
I have not verified the approach provided by @Naveen B but the approch which i have mentioned in this ariticle is worked for me and resolved the issue.
Can you try with the approch which I have mentioned and let us know the response.