In an organization, projects are created from approved proposals that are submitted by responsible teams. These proposals are evaluated by relevant teams prior to execution. After approval, creating projects with the necessary details from the proposal, manually is a tedious process. With this automation, projects are created automatically with the project details once a custom module's status is marked as approved. This allows teams to move directly to project planning and execution.
Consider a renewable energy firm that designs and installs solar power systems. They manage their prospects and system installation using Zoho Projects. When a sales executive takes up a new prospect, they gather the project requirements, site details, location, expected system capacity, and other information required for initial assessment. They add a record in the Site Assessments custom module for the technical team to review. Once the site status is Approved, the associated custom function creates a new project ensuring on-time project creation and handover.
To configure this flow in your Zoho Projects portal,
1. Create a
Custom Module by clicking on beside
Overview in the left navigation panel
→ Create Custom Module/Web Tab and add the required fields for the
Project Request.
2. Navigate to the upper-right corner of the page and click
→ Developer Space → Connections. 3. Click
Create Connection, choose
Zoho Projects as the service, and add the below scope for creating projects.
4. Navigate to Custom Functions under Developer Space.
5. Click the respective custom module's tab, here it is Site Assessment tab in the top panel.
6. Click Create a new custom function and add the below Deluge script.
- // scopes: ZohoProjects.custom_fields.READ, ZohoProjects.projects.CREATE
- getModules = invokeurl
- [
- url :projectsEndpointV3 + "/portal/" + portalId + "/settings/modules"
- type :GET
- connection:"projectintake"
- ];
- for each module in getModules
- {
- if(module.containskey("plural_name"))
- {
- isModulePresent = equalsIgnoreCase(module.get("plural_name"),moduleName);
- isRelatedModulePresent = equalsIgnoreCase(module.get("plural_name"),relatedModuleName);
- }
- else
- {
- isModulePresent = equalsIgnoreCase(module.get("singular_name"),moduleName);
- isRelatedModulePresent = equalsIgnoreCase(module.get("singular_name"),relatedModuleName);
- }
- if(isModulePresent == true)
- {
- moduleId = module.get("id");
- }
- if(isRelatedModulePresent == true)
- {
- relatedModuleId = module.get("id");
- }
- }
- if(moduleId != null && relatedModuleId != null)
- {
- params = Map();
- params.put("name",entityName);
- createProject = invokeurl
- [
- url :projectsEndpointV3 + "/portal/" + portalId + "/projects"
- type :POST
- parameters:params.toString()
- connection:"projectintake"
- ];
- }
- return "success";
Lines 5, 38: Replace projectintake with your Zoho Projects connection name.
7. Add the below arguments during configuration.
|
Parameter Name
|
Parameter Value
|
|
entityId
|
Entity Id
|
|
entityName
|
Title
|
|
moduleName
|
Site Assessment
|
|
portalId
|
Portal System ID
|
|
projectsEndpointV3
|
|
|
relatedModuleName
|
Projects
|
Replace the moduleName parameter value with the name of the custom module you want to use.
8. Click Save.
10. Click on the Site Assessment tab and click New Workflow Rule.
11. Select the execution criteria and configure the rule to run when the Status is Updated.
12. Set the criteria to execute the rule when the Status is Approved.
13. Click +Add Action and select Associate Custom Function. Select the custom function created previously
14. Click Save Rule.
15. Toggle the Workflow Rule status on to enable it.