Best answer

Multiple Salesforce Price Books/Price Book Entrys

  • 30 August 2022
  • 3 replies
  • 186 views

Userlevel 1

I have a zap set up for orders to come over from Shopify to Salesforce. 

The step where an order is created specifies the Standard Price Book, which is what I want. 

I have a step after that that uses “Run Javascript in code by Zapier.” This puts the proper sku, quantity, discount on one line. 

The next step is to find a pricebook entry for the above skus. Instead of picking the price book entry from the Standard Price Book, it is picking the first price book entry that comes up after searching by sku. I don’t understand why it is not pulling by what I specified in the “create an order” step. 

One sku could have multiple price book entries in Salesforce. I need to support that. Has anyone run into this and come up with a solution?

Thanks. 

Rachel

icon

Best answer by jesse 7 September 2022, 21:22

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

3 replies

Userlevel 7
Badge +9

Hey there @rachh! Thanks so much for reaching out.

I took a quick peek and it looks like you were able to open a ticket with my friends in support - which is perfect.

It looks like ya’ll are still working through this together but definitely keep us in the loop on the final solution! We’d love to know. 🤗

Userlevel 1

I have not heard back so I thought I’d post something out here to see if anyone else could help. 

Userlevel 7
Badge +9

Hey friends! Just coming in here to close the loop as it looks like our support team was able to help get this issue resolved. I am pasting my colleague Virgil’s advice here for anyone following along with a similar issue:

I'm not sure why the "Find Price Book Entry" Action is returning the ones from the wrong Price Book, but the fact that there is another Price Book with the same SKUs is likely relevant to the issue. 

Does this other Price Book have non-standard prices for some/all of those SKUs? 

In either case, I suspect Salesforce is performing the search for the SKU and sending over whichever one is returned first. I'm not sure what constitutes "first" in this case, but all I can say is that the search would return multiple results, ordered by some category, and SF just picks whichever one is at the top of the list and sends it to Zapier.

I did some testing and it looks like we may be able to do this with a "Find Record by Query" Action by creating a query that searches for both the SKU AND the Price Book ID using the ID value of the "Standard Price Book".

Then, replace the "Price Book Entry" mapped in your "Create Record" Step to use the "ID" value from this new "Find Record by Query" Action rather than the one from your original "Find Record" Action.