Solved

How to update Customer Attribute on customer sync

  • 4 January 2024
  • 6 replies
  • 80 views

Userlevel 2
Badge

Hi Team

We have a requirement where we want to update Acumatica Customer level attributes value (based on some configuration) while customer sync from BigCommerce to Acumatica.

Can you please suggest what is the best possible way to achieve it. 

 

Thank you in Advance!

icon

Best answer by simonliang91 5 January 2024, 22:17

View original

6 replies

Userlevel 5
Badge +1

@saikrishnav35 , you can use the Entity Mapping(BC202000) to achieve this goal.

The data source is from “ExternalField/Value” column, it can be a field name in the list, or the fixed value or value based on the formula.

 

Userlevel 2
Badge

Hi @simonliang91 


Thank you for the response.
The attribute values that we need to update are not directly available to a certain field but it is there in some other field in the form on json with some additional details and that is where we need to deserialize this json data, fetch the respective value and assign to the respective attribute. We tried to override MapBucketImport in CustomerProcessor graph to achieve this but that didn’t worked.

Userlevel 5
Badge +1

@saikrishnav35 , what’s the data source field in this case? Is it a form field? 

Please share the json data, I can provide more help.

Userlevel 2
Badge

Hi @simonliang91 , thank you for the response.
 
The attribute values will be there in order notes as json in below format:
{"Territory_Info":"Eastern,GA","xyz":"abc"}
On order sync, first customer will sync. At this time we will make additional API call to get order notes details. Then deserialize this json, fetch the required value and update the customer attributes.

Userlevel 5
Badge +1

@saikrishnav35 , if the source data is from order, I think it’s hard to get the correct order info in the Customer sync, because during the Customer sync process, it doesn’t have any order info. 

So I suggest to override the SaveBucketImport method in Order processor, you have both Customer and Order data in the Order processor, inside this method:

  1. you can get the the CustomerID from bucket.Order.Local.CustomerID field
  2. you can get the Customer localID(NoteID) from bucket.Customer.LocalID
  3. Get the source value from bucket.Order.Extern.NoteAttributes, NoteAttributes is a list of NameValuePair object(there are 2 fields inside NameValuePaie class, one is Name, another is Value), the source data in Shopify side is "note_attributes" field.
  4. Setup the customer attribute value
  5. Call the api to save customer into Acumatica
Userlevel 2
Badge

Hi @simonliang91 

Thanks for you response, I will check as per your suggestion.

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