12-13-2023 03:07 PM
I have created a Recipe in pilot a step
gets a related list from Opportunity Products in salesforce (which is a list of all the SKUs in an opportunity)
I then have a step
Batch Sales Order in Epicor Kinetic (batch) (Which creates a Sales order and loads all the SKus)
this is super cool
BUT we have 2 different companies in Epicor so I would like to do this exact thing but say 5 of the SKUs are from company 1 and 4 are for company 2
I created a field in SFDC so the opportunity product record would have company 1 or two but I can't figure out how to get the records with the condition for company 1 or 2.
anyway to do the get with conditions? I don't see a get action that has conditions options
Solved! Go to Solution.
12-14-2023 10:30 AM
Hi! You need to create a loop and iterate over the product list retrieve. Then, in the loop you will have an if/else condition. If Product Company = 1, proceed with X. Else - proceed with Y.
X & Y executions are essentially the same. But going to different Epicor Companies.
The use case guide and activity in this module can be helpful: https://academy.workato.com/working-with-databases
12-15-2023 07:01 AM - edited 12-15-2023 07:08 AM
Ok @johnw , just a quick comment. In the proposed solution, you are iterating over each of the Opportunity Products instead of creating the Sales Order in Epicor in batch, right? This solution, depending on the number of Opporunity Products and Sales Orders may consume a large number of tasks. My question is, instead of getting all the Opportunity Products in one action, have you tried to make 2 different searches filtering by Company using one of the following actions:
If you are using the "Search records" Action (simpler), you should be able to see the newly created custom field for Company in Salesforce. Ensure that the user you are using in the Workato SFDC connection has permission to access this field. Additionally, don't forget to refresh the recipe schema.
By obtaining the results in this manner, using two separate lists, you will be able to create the Sales Order in Epicor in batches through two different actions. This approach will require fewer tasks compared to the previous method.
Regards
12-15-2023 09:44 AM
check out this webinar for more info and best practices for task usage
https://www.workato.com/product-hub/best-practices-for-optimizing-and-monitoring-task-usage/