cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Salesforce Order and Order Product object update from ERP

johnw
Executive Chef I
Executive Chef I

I am looking at creating a recipe that will synch up our ERP orders from Epicor into the Order object in SFDC.

this will help with reporting on forecasting and backlog etc

what's the best practice here I can easily check to see if the Order exists in SFDC and update or create the order object but when I get to the Order products, I'm curious what the best practice is.

since I don't have the 18 digit ID I don't believe I can use the upsert function so should I just delete all the Order products under the Sales order and then readd all from Epicor whenever there is a change or am i missing something easier? 

1 ACCEPTED SOLUTION

shivakumara
Executive Chef I
Executive Chef I

Hi @johnw ,

Here are my thoughts on the requirements.

When integrating Epicor ERP orders with Salesforce (SFDC) using Workato, we can use the upsert function to manage order synchronization without needing the 18-digit Salesforce ID. Here are some best practices to follow:

1. Identify Changes in Epicor:
- Ensure you have a mechanism to identify when an order or order product in Epicor has been created, updated, or deleted. This can be achieved using change data capture (CDC) mechanisms or triggers in Epicor.

2. Mapping and Data Transformation:
- Clearly map the fields between Epicor and Salesforce. Make sure you transform the data as needed to match the format required by Salesforce.

3. Use Upsert Wisely:
- Use the upsert function in Workato to avoid duplicate records. Upsert will update existing records if they exist, or create new ones if they do not.
- Ensure you have a unique external ID field in Salesforce that can be used for the upsert operation. This can be an order number or another unique identifier from Epicor.

4. Efficient Data Handling:
- Avoid deleting and re-inserting all order products every time there is a change. Instead, track which specific order products have changed and only update those.
- Implement incremental syncs to process only the data that has changed since the last synchronization.

5. Batch Processing:
- If you are dealing with a large volume of data, consider using batch processing to handle the data in chunks, which can improve performance and reduce the risk of hitting API limits.

6. Error Handling and Logging:
- Implement robust error handling to catch and log any issues during the synchronization process. This will help you quickly identify and resolve any problems.
- Set up notifications for critical errors to ensure you are promptly alerted to any issues.

7. Testing and Validation:
- Thoroughly test the integration in a sandbox environment before deploying it to production. Ensure all possible scenarios are covered, including creation, updates, deletions, and edge cases.
- Validate that the data is correctly synced and appears as expected in Salesforce.

Example Workflow

1. Trigger: When a change is detected in Epicor (order creation, update, or deletion).
2. Retrieve Data: Fetch the relevant order and order product details from Epicor.
3. Data Transformation: Map and transform the data to match Salesforce fields.
4. Upsert Operation: Use the upsert function in Workato to sync the order and order products to Salesforce.
5. Error Handling: Implement error handling and logging to capture any issues.

Please let me whether these detailed steps helps? 

Thanks and Regards,
Shivakumara Avadhani

 

View solution in original post

4 REPLIES 4

shivakumara
Executive Chef I
Executive Chef I

Hi @johnw ,

Here are my thoughts on the requirements.

When integrating Epicor ERP orders with Salesforce (SFDC) using Workato, we can use the upsert function to manage order synchronization without needing the 18-digit Salesforce ID. Here are some best practices to follow:

1. Identify Changes in Epicor:
- Ensure you have a mechanism to identify when an order or order product in Epicor has been created, updated, or deleted. This can be achieved using change data capture (CDC) mechanisms or triggers in Epicor.

2. Mapping and Data Transformation:
- Clearly map the fields between Epicor and Salesforce. Make sure you transform the data as needed to match the format required by Salesforce.

3. Use Upsert Wisely:
- Use the upsert function in Workato to avoid duplicate records. Upsert will update existing records if they exist, or create new ones if they do not.
- Ensure you have a unique external ID field in Salesforce that can be used for the upsert operation. This can be an order number or another unique identifier from Epicor.

4. Efficient Data Handling:
- Avoid deleting and re-inserting all order products every time there is a change. Instead, track which specific order products have changed and only update those.
- Implement incremental syncs to process only the data that has changed since the last synchronization.

5. Batch Processing:
- If you are dealing with a large volume of data, consider using batch processing to handle the data in chunks, which can improve performance and reduce the risk of hitting API limits.

6. Error Handling and Logging:
- Implement robust error handling to catch and log any issues during the synchronization process. This will help you quickly identify and resolve any problems.
- Set up notifications for critical errors to ensure you are promptly alerted to any issues.

7. Testing and Validation:
- Thoroughly test the integration in a sandbox environment before deploying it to production. Ensure all possible scenarios are covered, including creation, updates, deletions, and edge cases.
- Validate that the data is correctly synced and appears as expected in Salesforce.

Example Workflow

1. Trigger: When a change is detected in Epicor (order creation, update, or deletion).
2. Retrieve Data: Fetch the relevant order and order product details from Epicor.
3. Data Transformation: Map and transform the data to match Salesforce fields.
4. Upsert Operation: Use the upsert function in Workato to sync the order and order products to Salesforce.
5. Error Handling: Implement error handling and logging to capture any issues.

Please let me whether these detailed steps helps? 

Thanks and Regards,
Shivakumara Avadhani

 

johnw
Executive Chef I
Executive Chef I

Wow this is awesomeโ€ฆ. Thanks

One question about a unique identifier field on the Order Product object

So on the Order I will create an External ID which will be the Erp Sales order that seems straight forward

But on the Order product in SFDC do I create an external ID field and combine say the Sales Order number and the Line number to make a unique ID ? or can upsert use a combination of fields to find a unique record ?

Hi @johnw ,

At the order Product in SFDC check what is the unique key which we can save it in an Epicor so that during next run we can use that unique to check whether to do create/update operation.

I hope I answered your query.

Thanks and Regards,
Shivakumara Avadhani

johnw
Executive Chef I
Executive Chef I

before I got here for Parts/SKUs, Pricing records and Customer account etc someone was manually updating the SFDc 18 digit ID in Epicor so i have been using that for thsoe BUT I have to loop through and do testing for example someone in Epicor might clone SKU XYZaa to be XYZab so if I blindly do the 18 digit ID it would be pointed to the old aa version.

my thought for orders... in SFDC create an external ID field which would be unique and made up by Sales order # - Line Rel from epricor

then I'm thinking i could just do an upsertt and use the key SO# - Line Rel

so if 123456 - 1.2 changes in Epicor it will overwrite it in sfdc

123456 - 2.1 doesn't exist in SFDC so it would create it etc

I'm getting ready to test this but waiting on a Epicor admin to fix something for me unrelated but does anyone see a flaw in this?