I am currently writing an integration between Kinetic and Salesforce. I have the Order and OrderItems updating correctly using Upsert for Order and Upsert Batch for OrderItems.
The part I am struggling to figure out is how to capture deleted lines from the Order. Even once the line is found, there is no way to batch delete which would consume many tasks to loop through each line.
I’m curious if anyone else has had a similar issue and what you did to resolve it?
You can call automation studio recipes from BPMs. Just set one up that accepts the SysRowID of the deleted line and then assuming you’re using SysTags to store the corresponding sales force id you can look it up in your recipe and delete the corresponding line in salesforce on a per order line basis.
Thats a good option I didn’t think of. Is there a way to batch that? We currently have a customization around configurators that will delete and readd many lines, so it may consume lots of tasks.
If you really need to batch it then you could instead write to a UD table in the bpm (via an epicor function) with the rows you need to delete and then have a recipe that runs on a schedule to pull the records in from that UD table and then call another epicor function in that recipe to clear the records out that you’ve processed for that given batch. The trade off that you’ll be making is having data inaccuracies in Salesforce that last for the cadence that your recipe runs on.
I went a slightly different route. I created an HttpPost action in Salesforce that I can call from Automation Studio and passed in the OrderNumber to delete all lines, then readded them in the recipe. We dont save any info on the lines in SF that is not in Epicor, so readding them each time is not an issue.