locked
Custom WebService Best Practice Question RRS feed

  • Question

  • We have created a Custom Web Api based RESTfull service that interacts with CRM Services.

    We have few methods that have very complex business logic and it makes number of CRMService calls like RetrieveMultiple, Retrieve, Update, Create etc. this business process ideally need to be ran under Database Transactions so that if anything fails that the whole process can be rolled back

    From best practices, performance and transaction point of view can some of you please suggest some ideas?

    One of the suggestion was to create Custom CRM Entity as a staging process and write all the triggering states to that entity record and let CRM may be plugins handle the business process  and that would mean it runs under the plugin process pipeline transaction. Do any of you think this approach would work? can you comment on this approach!

    Thank you in advance

    Friday, October 10, 2014 11:27 AM

All replies

  • The suggestion you have is a good one.  In fact we have done this, using a 'RunPlugin' entity for a few years now in CRM.

    However, in the latest version of CRM 2013 you now have a potentially better option, called Actions.  This is effectively a workflow that accepts in/out arguments, runs on demand, and runs within a transaction context (as long as the actions you perform within it support transactions).

    Friday, October 10, 2014 1:36 PM