Search code examples
dynamics-crmdynamics-crm-2015

Execute custom code in CRM


Is there a way I can execute custom code in c# when a user clicks a button in the CRM application? I would like it a synchronous and asynchronous approach. Actually something like when putting a button on a webform with a wired code behind click event handler. And how can I add a button? I want to display a list of report views the customer has assembled and access the report data in the CRM database.

It seems so complicated with CRM! Here's an example of a custom workflow with a bunch of XAML. I dont know where they got it from.

Sample: Create a workflow in code


Solution

  • One way to go about it:

    1. Use Ribbon WorkBench add add a button to the form. Only supported way of adding buttons to CRM is by editing ribbon XML.
    2. Add an on click JavaScript Event Handler.
    3. Call an Action which can be used to call a custom workflow where you can perform business logic.