Microsoft Dynamics CRM (MS CRM) is a powerful customer relationship management platform that helps businesses to manage their interactions with customers, clients, and sales leads. While MS CRM has many built-in features that are designed to streamline and automate business processes, there may be times when you need to create custom actions to meet specific requirements.
In this article, we’ll explore what MS CRM custom actions are, how they work, and how you can use them to enhance your business processes.
What is MS CRM Custom Actions?
MS CRM custom actions are custom workflows that can be created and triggered in response to specific events or actions within MS CRM. They allow you to automate complex business processes and perform custom actions on your data, such as creating new records, updating existing records, and sending notifications.
Custom actions can be triggered manually by users or automatically based on specific conditions, and they can be used to perform a wide range of tasks, such as:
- Creating a new lead when a website form is submitted
- Updating a record when a specific field is changed
- Sending an email notification when a record is created or updated
- Automatically assigning a task to a specific user when a record is created
How do MS CRM Custom Actions Work?
MS CRM custom actions are created using a visual workflow designer, which allows you to define the steps and conditions that make up the custom action. You can use a variety of pre-built actions, such as creating a record, updating a record, or sending an email, and you can also create custom actions using JavaScript.
Once you’ve created your custom action, you can trigger it by using a plugin, a workflow, or a button on a form. You can also configure the custom action to run automatically based on specific conditions, such as when a record is created or updated.
How to Use MS CRM Custom Actions to Enhance Your Business Processes?
One of the key benefits of MS CRM custom actions is that they allow you to automate complex business processes and streamline your workflows. By creating custom actions, you can:
- Save time and effort by automating repetitive tasks
- Improve data accuracy by ensuring that actions are performed consistently and correctly
- Enhance collaboration by automatically assigning tasks to specific users
- Increase efficiency by automating the flow of information and reducing the need for manual intervention

To get the most out of MS CRM custom actions, it’s important to understand your business processes and identify areas where custom actions could provide a solution. You should also be familiar with the visual workflow designer and the types of actions that are available.
Here’s an example of how you can use MS CRM custom actions and JavaScript to create a custom action that automatically assigns a task to a specific user when a new lead is created.
- Create a new custom action:
The first step is to create a new custom action. To do this, go to Settings > Processes in MS CRM, and click on the New button. Select the Custom action option and give your custom action a name, such as “Auto Assign Lead Task”.
- Configure the custom action
Next, you’ll need to configure the custom action. You can do this using the visual workflow designer by adding steps and conditions. In this example, you’ll want to add two steps:
- Create a new task
- Assign the task to a specific user
To create a new task, you’ll need to use the Create Record action. In the Configuration section, you’ll need to select the Task entity and specify the values for the Subject and Description fields.
To assign the task to a specific user, you’ll need to use the Assign action. In the Configuration section, you’ll need to select the user to whom you want to assign the task.
- Add JavaScript code to the custom action:

To make the custom action run automatically when a new lead is created, you’ll need to add JavaScript code to the custom action. This code will use the Xrm.WebApi method to create the lead and trigger the custom action.
Here’s an example of what the JavaScript code might look like:
function createLeadAndAssignTask() {
var lead = {};
lead.Subject = "Test Lead";
lead.Description = "Test lead description";
Xrm.WebApi.createRecord("lead", lead).then(
function success(result) {
Xrm.WebApi.executeAction("your_custom_action_name", {
LeadId: result.id
}).then(
function success(result) {
console.log("Task created and assigned successfully");
},
function (error) {
console.log(error.message);
});
},
function (error) {
console.log(error.message);
});
}
4. Test the custom action:
Once you’ve added the JavaScript code, you can test your custom action by creating a new lead in MS CRM and checking to see if a task has been created and assigned to the specified user.
Note: In this example, it’s assumed that you already have a lead entity set up in MS CRM and that you have a user with the necessary permissions to create and assign tasks.
This is just one example of how you can use MS CRM custom actions and JavaScript to automate your business processes. With a little creativity, you can use custom actions to perform a wide range of tasks, from sending notifications to updating records, and more. In conclusion, MS CRM custom actions are a powerful tool that can help businesses to automate complex processes, streamline workflows, and improve the overall efficiency of their operations. By using custom actions, businesses can save time and effort, improve data accuracy, and enhance collaboration between teams. Whether you’re a seasoned MS CRM user or just getting started, custom actions are an important tool to have in your toolkit.