Fetch Custom Field API Names in zoho Project (Standard or custom) with Zoho CRM

How to fetch custom field API names in Zoho Projects and create a project from Zoho CRM using Deluge script.

Overview

Integrating Zoho Projects with Zoho CRM can greatly improve project management and automation across your organization. One of the key steps in this integration is fetching custom field API names from Zoho Projects, which are required when creating a new project from Zoho CRM using Deluge scripting. This blog post will guide you through the process of fetching custom field API names and creating a project in Zoho Projects directly from Zoho CRM.

Step 1: Fetching Custom Field API Names in Zoho Projects

1.1 Open Zoho Projects

Log in to your Zoho Projects application.

1.2 Navigate to Layouts and Fields

  • Click on the settings icon in Zoho Projects.
  • Go to the Customization tab.
  • Under the Layouts & Fields section, click on Projects to view or modify the project layout.

For Example,you can add a new section called "Projection Details" & add fields like No. of Repeated Order,Repeat Frequency,Repeat Order Date,Project Timeline Status.



1.4 Fetch Custom Field API Names

To fetch the API names of these added custom fields, make an API call using the following URL:

https://projectsapi.zoho.in/restapi/portal/{portal_name}/projects/customfields/

Replace {portal_name} with your portal’s actual name. For Example:-if your portal is "honecoredotcom", the URL will be:

https://projectsapi.zoho.in/restapi/portal/honecoredotcom/projects/customfields/

This API call will return the list of API names for the custom fields, which will be needed in the Deluge script.

API Link : https://www.zoho.com/projects/help/rest-api/projects-api.html#alink3


Step 2: Creating a Project from Zoho CRM using Deluge Script

2.1 Open Zoho CRM

Navigate to Zoho CRM settings icon.

2.2 Access the Developer Hub

Go to the Developer Hub section, click on Functions and select New Function to create a custom function.

2.3 Create a Connection

In Zoho CRM, create a connection named "zcrm" with the required API scopes. Ensure that the connection includes the following API scope

zoho.projects.ALL

2.4 Sample Deluge Code

Here is a sample Deluge script to fetch the deal details from Zoho CRM and create a new project in Zoho Projects:

deluge

// Fetch the deal details from Zoho CRM
getDeal = zoho.crm.getRecordById("Deals", Dealid); // Fetch custom field API names from Zoho Projects GetProjectDetails = invokeurl [ url :"https://projectsapi.zoho.in/restapi/portal/honecoredotcom/projects/customfields/" type :GET connection:"zcrm" ]; info GetProjectDetails; // Map project details mp = Map(); mp.put("name", ifnull(getDeal.get("Deal_Name"), "")); // Project Name mp.put("owner_zpuid", "205165000000032021"); // Project Owner mp.put("start_date", zoho.currentdate.toString("MM-dd-yyyy")); // Start Date mp.put("end_date", zoho.currentdate.addDay(3).toString("MM-dd-yyyy")); // End Date // Custom Fields mp.put("UDF_CHAR6", ifnull(getDeal.get("Projections"), "")); // No. of Repeat Orders if (!isNull(getDeal.get("Projection_Date"))) { mp.put("UDF_DATE1", ifnull(getDeal.get("Projection_Date").toDate(), "")); // Repeat Order Date } mp.put("UDF_CHAR9", ifnull(getDeal.get("Projection_Term"), "")); // Repeat Frequency mp.put("UDF_CHAR1", ifnull(getDeal.get("Estimated_Target_BOM"), "")); // Estimated Target BOM // Project API Endpoint portalname = "honecoredotcom"; portalID = "60025983370"; projectsAPIEndPoint = "https://projectsapi.zoho.in/restapi"; url = projectsAPIEndPoint + "/portal/" + portalID + "/projects/"; // Call API to create a new project resp = invokeurl [ url : url type : POST parameters: mp connection: "zcrm" ]; info resp;



x

Note:- My Project Standard Layout Custom field API names which I got through the Api Hit :-

(url :"https://projectsapi.zoho.in/restapi/portal/"+"honecoredotcom"+"/projects/customfields/")

2.5 Custom Field API Names

Once the API call is made to fetch the custom field details, the following API names can be used in the script:

  • No. of Repeat Orders"UDF_CHAR6"
  • Repeat Frequency"UDF_CHAR9"
  • Repeat Order Date"UDF_DATE1"
  • Project Timeline Status"UDF_CHAR17"

Conclusion

By following these steps, you can easily fetch custom field API names from Zoho Projects and use Zoho CRM to create new projects using Deluge scripting. This integration improves automation between your CRM and project management systems, ensuring a streamlined workflow.

Post a Comment