Overview:
A Zoho CRM user may want to automate the process of moving records in bulk from one blueprint to another. However, Zoho CRM does not provide this option by default.
This can be achieved seamlessly by using the Blueprint API in combination with workflows, field updates, and custom functions
Business Scenarios:
The custom solution outlined in this document can be applied in the following scenarios:
When a specific set of records needs to be moved from one blueprint to another based on a field value or condition during the process.
When records have entered the wrong blueprint and need to be redirected to the correct one.
Challenges:
The usual method followed by users to move records from one blueprint to another involves several difficulties:
- Each transition in the current blueprint must be executed manually for every record in order to exit from the current blueprint.
- After exiting, a mass update is required to move the records into the new blueprint.
This entire process is time-consuming and inefficient.
Solution:
With the proposed setup, users can simply perform a mass update on a dummy checkbox field. This action will trigger a workflow rule, which in turn executes the associated custom function. The function will automatically exit the records from the existing blueprint and move them into the new blueprint.
Permission & Availability
Manage Extensibility – Required to create connections and write custom functions.
Manage Automation – Required to configure Workflow Rules and Blueprints.
Manage Customization – Required to create custom fields.
Implementation Steps:
Source Blueprint
The sample blueprint mentioned here is created for the Deals module. Ensure that both the source and target blueprints are configured for the same module.
Note: It is mandatory to configure the final transition in the first blueprint as a common transition. This allows the record to move to the final stage from any previous stage, enabling it to exit the blueprint without restrictions.
Target Blueprint
Step 1: Create checkbox field
Navigate to Modules and Fields > Deals module > Layout > Create a dummy check box field.
This checkbox will act as a trigger for the process. To move multiple records to another blueprint, you can bulk update this field for the required records which will trigger the workflow and the function associated with the workflow will move the records to the target blueprint.
Step 2: Set Up a Workflow Rule
- Go to Automation > Workflow Rules. Create a new rule for the respective module for which the blueprint is configured.
- Set the trigger as when the checkbox field is selected.
- Define the condition: Checkbox is selected.

Step 3: Create a Connection
Navigate to Setup in Zoho CRM > Developer Hub > Connections > My Connection > Create Connection
Select "Zoho OAuth" as service and provide Name to "Connection". Then, select the below
scope: ZohoCRM.modules.ALL
Step 4: Associate the Custom Function
Please use the below custom function to move the record from one blueprint to another blueprint.
Custom Function Script
void automation.MoveBlueprint(Int dealId)
{
//Update the stage to the last stage of the blueprint
UpdateDealStage = zoho.crm.updateRecord("Deals",dealId.toLong(),{"Stage":"Validation"});
info UpdateDealStage;
blueprintMap = Map();
//Transition id should be fetched using another code.
blueprintMap.put({"blueprint":{{"transition_id":"6649548000002229171"}}});
if(UpdateDealStage.get("code") == "RECORD_IN_BLUEPRINT")
{
response = invokeurl
[
type :PUT
parameters:blueprintMap.toString()
connection:"test"
];
info response;
}
//record comes out of the first blueprint
//Update the second blueprint first stage and entry criteria (if any)
UpdateNewBlueprintStage = zoho.crm.updateRecord("Deals",dealId,{"Stage":"Proposal Submission","trigger":"blueprint"});
info UpdateNewBlueprintStage;
}
Map the dealId parameter in the argument section to the Deal record ID.
In the provided script, replace the connection "test" with your actual Connection Name.
Response:
Explanation of the Custom Function Script:
- Update the final state of the current blueprint: The script updates the stage value (final state of the blueprint) for the record being executed.
- Pass the Transition ID: The Transition ID of the final (common) transition is passed in the Blueprint API to move the record to the last stage, the record exits the current blueprint.
This Transition ID can be fetched using a separate script (shared below). - Update the initial state of the next blueprint: The script then updates the stage field to the starting state of the second blueprint, enabling the record to enter it.
Note: If the second blueprint has any entry criteria, make sure those conditions are also updated in the script. The script uses the Transition ID of the final transition in the first blueprint to exit the record.
Use the sample script provided to retrieve this Transition ID.
void automation.GetTransitionId(Int Did)
{
response = invokeurl
[
type :GET
connection:"madhu"
];
info response;
}
The above script returns the current and upcoming transition details for a specific record. Create a test record that satisfies the conditions to enter the blueprint. Since the last transition is set as a common transition, its ID is consistently returned across all stages. Once the record is inside the blueprint, execute the script to retrieve the transition ID. This ID is necessary to exit the record from the current blueprint.
Video Reference:
You can view the detailed screen recording demonstrating the results of moving the set of records from one blueprint to another by accessing the link.
Screencast Video:
To ensure a smooth implementation, we recommend configuring and testing the setup in the sandbox environment before deploying it to production.
TIPS: Avoid Common Errors
-> Ensure to use the correct API Names for both Module & Fields in the script.
-> To ensure you get the intended output, we would suggest you to use info() logs to each variable to check the output for seamless functionality under the Console section within Zoho CRM Function IDE.
-> Since we have used the Connections within a function script, ensure to have the required scopes added in connection to perform the intended API action. Also, ensure to use the connection link name (i.e., crm_connection ) while passing on to Deluge Invoke URL or Integration Task.
-> As a common practice, we have used US DC API end point. If you are using CRM account in a different DC (i.e., IN, EU, CA, AU, etc.), then we would recommend you to use the API end point URL according to your DC.
For example:
-> Since the Automation Feature (e.g., Workflow Rules) is involved in this use-case, if the intended functionality does not work, then users can check the associated function failure reason under "Setup >> Developer Hub >> Functions >> Failures". Additionally, Users can also see the complete Log of all function execution for any specific created function to track the executions (i.e. under My Functions >> 3 Dots >> Logs). This also help in a scenario where a function is executed via Workflow rule in CRM record(shows in timeline), however it didn't perform the intended actions/updates in record. In such scenario, users can check the output (info logs) & error of execution via function logs within Zoho CRM.
Notes: Refer to the following Guide - Article to learn the best practices for Optimizing the code and various ways to deploy Custom Function across Zoho CRM.
Custom Solution Created by Madhu Sree T | Zoho Partner Support.