Let me share a story about Bob, a frustrated order processor in need of a tightly integrated system... Bob is processing an order in Dynamics CRM. He pushes the “Submit Order Button” confidently knowing that the order is whizzing around servers, surfing thru the clouds, and eventually landing in the appropriate ERP system. While all of this integration goodness happens his customer waits patiently on the phone. They both await for the all-important Confirmation Number. This number shows up in CRM once the order is accepted in the ERP system, it is the indicator of Order Success. Pressing the F5 key to refreshe the screen he waits. No Confirmation Number appears.
“The computers must be a little slow today,” he says with nervousness in his voice. “How is the weather in your city? We just had several inches of rain.” He adds, “...Well, you don’t need to wait any longer. When this Confirmation Number comes back I will give you a ring back. Have a great day, and thanks again for your order.”
Needless to say, Bob is a bit frustrated that he is unable to get a confirmation that the order had made its way into their ERP system. He quickly dials the phone and calls his IT help desk. “Where is my order number? What is going on back there? I had a customer on the phone and…”
The fact is that a CRM to ERP integration can fail for myriad reasons. The customer may be on Credit Hold, or the product that is being ordered is not in stock, or is discontinued. This is a major challenge of “loose integrations”, that is, where the business logic is not replicated in both systems. So if a failure happens in one system the other system needs to be notified of the failure.
What can be done to address the issue specifically with end users?
In Insight version 7 we introduced a new feature called “Multi Target”. This feature allows one to build a .dts that writes to multiple objects, including the source object. In this article I will show you how to capture the error message and send it back to CRM so the user can see the status of the order, almost immediately.
Step 1 – Create a Field for the Error Message
First in Dynamics CRM you will want to create, or reuse a field on the Order to send the message into. In my example here, I am creating a field and placing it on the top of the form. However you could use many mechanisms for this. You could create an activity and send an e-mail to the Order Owner, or add a Note to the Order, or create and entry in the Activity feed if that was being used. In this example I am just going to put the error into the Description field.
Step 2 Add a Connection to Source CRM system
In this example I am going to use a sample .dts, from one of our templates, whose source is XML and whose target is an ERP system. This XML comes to the .dts from the CRM Publisher; so we need a connection to the Dynamics CRM adapter that we can use as another target.
Step 3 – Add Step to Update CRM Order as the Last Step
From the configure steps window, add an update step Sales Orders. Don’t forget to define the lookup link on the SalesOrderId.
Step 4 – Push all the Failed Steps to the Order Update Step You Just Added
All the steps need to have their Fail option set to goto the Update CRM Order steps.
Step 5 – Edit Step 5 to Copy the Error Message Into the Field You Designated in Step 1.
You can prefix the message with some text or just put the data straight in. The formula that copies the error message is GETROWERROR().This function will return any error information that occurred while processing a row.
Step 6 – Run the .dts and ERP Error Shows On the CRM Order Screen
When the .dts encounters an error, two things occur. First the DTS will record an error in the event log allowing for any notification settings in the console to notify the appropriate individuals of the error. Second, and most importantly, the ERP error will show up on the screen in CRM.