I need to implement a bi-directional communication between Microsoft Dynamics CRM and a 3rd party server. The ideal scenario is as follows:
- User tries to create an entity in CRM
- In pre-create hook a 3rd party library function is called (or web service or whatever), filled with relevant info, which tries to create the respective entity on the server
- If the call fails, creation fails in CRM
- If the call succeeds, the entity is created in the CRM AND additional fields are filled with return values from the call
More specifically, I want to do something like this when user tries to create a new entity instance:
try {
ExternalWebService.CreateTrade(ref TradeInfo info)
//this was initialized on the external server
myCRM_Trade_Entity.SerialNo = info.SerialNo;
CreateNew(myCRM_Trade_Entity);
} catch (whatever) {
fail;
}
What would be the suggested way to do this? I am new to Dynamics, have read about Workflows and Plugins but am not sure how should I do this properly.