A super quick article to demonstrate an example where we create a project with custom fields.
Why?
At time of print, the documentation on the Projects API would only show responses rather than requests. Sure it lists fields that are required in the request but not a sample request packaged to be sent.
How?
Let's assume that my custom fields have as identifiers UDF_CHAR8 (which is a Zoho ID) and UDF_CHAR7 (which is a text/string name field). Note that in the below snippet, I've put m_Params into separate lines for display purposes but actually it should be all on one line:
copyraw
m_Custom = {"UDF_CHAR8":12345678901234567,"UDF_CHAR7":"Joel Lipman"}; m_Params = { "name": "My Happy Project", "flag": "internal", "milestone_id": 98765432109876540, "tasklist_id": 78901234567890130, "person_responsible": "20211234567", "duration": "1", "duration_type": "hrs", "start_date": "11-12-2021", "end_date": "12-12-2021", "percent_complete": "0", "order_sequence": "4", "priority": "None", "custom_fields": m_Custom.toString() }; r_CreateResponse = zoho.projects.create("joelsprojects",45678901234567890,"tasks",m_Params );
- m_Custom = {"UDF_CHAR8":12345678901234567,"UDF_CHAR7":"Joel Lipman"};
- m_Params = {
- "name": "My Happy Project",
- "flag": "internal",
- "milestone_id": 98765432109876540,
- "tasklist_id": 78901234567890130,
- "person_responsible": "20211234567",
- "duration": "1",
- "duration_type": "hrs",
- "start_date": "11-12-2021",
- "end_date": "12-12-2021",
- "percent_complete": "0",
- "order_sequence": "4",
- "priority": "None",
- "custom_fields": m_Custom.toString()
- };
- r_CreateResponse = zoho.projects.create("joelsprojects",45678901234567890,"tasks",m_Params );
Category: Zoho :: Article: 748
Add comment