Solved

Sync sales categories to Shopify metafield

  • 11 February 2023
  • 11 replies
  • 134 views

Userlevel 5
Badge +1

Currently on 21R1, in the process of upgrading to 22R2 - is it possible in 22R2 to map product Sales Categories to a product/variant metafield in Shopify?

icon

Best answer by mikeho 21 February 2023, 00:58

View original

11 replies

Userlevel 7
Badge +6

Hi @mikeho , no, this is impossible. 2 data types are incompatible. In Acumatica (just like in Shopify) a product can be assigned to multiple sales categories. So, it’s one-to-many relationship. At the same time, if you were to populate a metafield for a product, it would be a one-to-one relationship. Also, sales categories are tiered (parent-child structure), while metafields are flat.

What’s your business case?

If you wanted to put 1 data point from Acumatica to a meatfield in Shopify, I would recommend using an Attribute in Acumatica and map to a metafield in Shopify.

Hope this helps.

Userlevel 5
Badge +1

Hi @mikeho, i suggest to use the attributes to provide such kind of data (as already mentioned). Attributes in Acumatica you can mapp to the metafields in shopify. 

Userlevel 5
Badge +1

Hi @Yuri Karpenko & @PatrickSchlenker90 - using the tiered, category tree structure in Acumatica is preferable for managing product categories as we have over 50k products so trying to manage these by attributes just isn’t tenable. And the reason for syncing them to a metafield in Shopify is for backend categorization processes.

It sounds like if we did want to use sales categories in Acumatica then we’d need to create a customization to pull them into a single field that we can map to a metafield in Shopify?

Userlevel 7
Badge +6

@mikeho , in this situation, I would recommend keep using Sales Categories in Acumatica as designed. Then create an Attribute in Acumatica to hold the value you need from the Sales Categories (text field), then create a Business Event to watch for changes in Sales Categories per product, and trigger an update to that Attribute when a change is detected. And then map that Attribute to a meta-field in Shopify. Does it make sense?

Userlevel 5
Badge +1

@Yuri Karpenko - that sounds like that would work for our needs. Would you happen to be able to provide the steps for setting up a Business Event to update an Attribute based on a change to the Sales Categories? I’ve had some misfires when I’ve tried to so something similar in the past.

Userlevel 7
Badge +6

@mikeho , for this specific scenario, I would recommend setting up a GI with Sales Categories and SKUs (INItemCategory and InventoryItem tables), and then set up a schedule to run the business event. I wouldn’t recommend doing a trigger by record change, because that can be finicky. Hope this helps.

Userlevel 5
Badge +1

@Yuri Karpenko - thank you! I’m still a little unclear how you would use the Business Event in conjunction with the GI to update this attribute field. Can you provide more clarification?

Userlevel 7
Badge +6

Hi @mikeho , sorry for my late reply. But most Business Events are based on the GI. You build a GI that has a list of all your SKUs, inner joined with Sales Categories and filtered on LastUpdatedDateTime field, so you only see items that were updated in the last 30 minutes, for instance. And then you set up a Schedule to run every 30 minutes to grab the data from the GI and update those SKUs attributes.

It’s hard to provide exact details though.

Userlevel 5
Badge +1

@Yuri Karpenko - I see, so it would just be an import of the GI results based on the last modified field, set on a schedule that corresponds to the last modified date filter. 

Out of curiosity - couldn’t this same thing be done by creating an Import Scenario off of a GI result, and then an Automation Schedule on the Process Import Scenarios screen (SM206035)? Not sure I understand the benefits of using a Business Event for this instead?

Userlevel 7
Badge +6

@mikeho , I think you can get away without Business Event in this case, actually. Good thinking!

Userlevel 5
Badge +1

Thanks, @Yuri Karpenko !

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