Create Project while winning potentials - Projects v3 api updated code

Create Project while winning potentials - Projects v3 api updated code

Hi all, I've been using the built in function to create a project while a deal is closed won and noticed it had some missing fields when trying to reference the zoho projects v3 api documentation. Specifically the project group had some issues when adding which caused me to have to change the project creation code from zoho.projects.createproject to an api call. 

Also here is the link to the api documentation for reference: Projects v3 Api Docs

I wanted to share my code in case some other people had some issues similar because this took some time to figure out and a few messages to support. A couple important notes, with the built in function I used custom field column names to populate them, with the v3 call I can reference their api names. If youre having troubles finding the custom project fields api names I used these calls in crm as standalone functions to reference them: 

  1. response = invokeurl
  2. [
  3. url :"https://projectsapi.zoho.com/api/v3/portal/[portal id]/module/[project module id]/fields"
  4. type :GET
  5. connection:"zohoprojects"
  6. ];
  7. info response;
Also to get your projects module information I did the same thing with this url: 

  1. url :"https://projectsapi.zoho.com/api/v3/portal/[portal id]/settings/modules"

Finally I will share my code for reference and some comments to show my changes, 

  1. void automation.Create_Projects_for_Closed_Potentials2(String ProjName,String PortalName,String TemplateID,String Description,Date startdate,Date enddate,String id)
  2. {
  3. /*
  4. ProjName Jobs.Jobs Name
  5. Description Jobs.Description
  6. startdate Jobs.Last Activity Time
  7. enddate Jobs.Closing Date (This can be changed will see)
  8. id Jobs.Jobs Id
  9. PortalName name of our portal - Depreciated parameter 
  10. TemplateID #########  (Template id found in template url)
  11. */
  12. createMap = Map();
  13. dealRecord = zoho.crm.getRecordById("Deals",id.toLong());
  14. descriptionText = " Job Schedule:";
  15. jobDays = dealRecord.get("Job_Days");
  16. if(jobDays != null)
  17. {
  18. descriptionText = "";
  19. moveDateRaw = null;
  20. for each  row in jobDays
  21. {
  22. d = ifnull(row.get("Day"),"");
  23. tt = ifnull(row.get("Addresses_Needed"),"");
  24. des = ifnull(row.get("Description"),"");
  25. if(moveDateRaw == null && row.get("Date_Time") != null)
  26. {
  27. moveDateRaw = row.get("Date_Time").toDateTime().toDate();
  28. }
  29. line = "Address: " + tt + "Description: " + des;
  30. descriptionText = descriptionText + line;
  31. }
  32. if(moveDateRaw != null)
  33. {
  34. createMap.put("move_date_1",moveDateRaw.toString("yyyy-MM-dd")); // Custom field api, plus strict date formatting into projects 
  35. }
  36. else
  37. {
  38. info "No valid Start_Time found in Job_Days.";
  39. }
  40. }
  41. else
  42. {
  43. info " jobDays is null. No subform data available.";
  44. }
  45. ProjName = dealRecord.get("Deal_Name");
  46. createMap.put("name",ProjName);
  47. createMap.put("description",Description);
  48. createMap.put("copy_from", TemplateID); // used to be the field "template_id"
  49. createMap.put("day",id); // custom field api name
  50. projectGroupMap = Map();
  51. projectGroupMap.put("id",######); // group id to assign project to on creation
  52. createMap.put("project_group",projectGroupMap);
  53. // Old create call, below is the new v3 api call
  54. // response = zoho.projects.createProject(PortalName,createMap,"zohooauth");
  55. resp = invokeurl
  56. [
  57. url :"https://projectsapi.zoho.com/api/v3/portal/[portal id]/projects"
  58. type :POST
  59. parameters:createMap.toString()
  60. connection:"zohoprojects"
  61. ];
  62. info "Project update response: " + resp.toString();
  63. projid = resp.get("id");
  64. if(projid != null)
  65. {
  66. updateMap = Map();
  67. updateMap.put("Project_ID",projid);
  68. updateResp = zoho.crm.updateRecord("Deals",id.toLong(),updateMap);
  69. info "Project ID stored in CRM: " + updateResp.toString();
  70. }
  71. assocMap = Map();
  72. assocMap.put("name",ProjName);
  73. assocList = List();
  74. assocList.add(assocMap);
  75. wrapper = Map();
  76. wrapper.put("data",assocList);
  77. response = invokeurl
  78. [
  79. url :"https://www.zohoapis.com/crm/v2/Deals/" + id + "/Zoho_Projects/" + projid
  80. type :POST
  81. parameters:wrapper.toString()
  82. connection:"zohooauth"
  83. ];
  84. info "CRM Respopnse: " + response.toString();
  85. }
    • Sticky Posts

    • How to Add Users to your Organization in ZohoMail?

      A better clarity so you can create other users to start using Zoho Mail. You can directly Add Users from the Control Panel to your Organization. You can invite users with the existing email address. If the person (user) already uses ZohoCRM, then you can import users from Zoho CRM. You can also import them using a .csv file. (if you are planning to add them in Bulk)  In this topic, We will be discussing on how to Add and Invite users only.  The Import options are self explanatory. ____________________________________________________________________________________________________________
    • Recent Topics

    • Bulk Fill In & Edit PO/Bill/SO/Invoice

      Hello, I am adding stock in bulk on a PO, the system is automatically populating the Rate (price) and Tax from the item data. Problem is that the bill rate is different from the rate on the item data, so I have to manually erase each and enter the price.
    • Fixed Assets beg balance

      Hello, I trust you are well I'm a new zoho books user and I find it difficult to plug in the fixed assets balance and here's what I have done: 1- I imported the fixed assets data into the fixed assets module as per the instructions 2- the import process
    • Syncing with Google calendar, Tasks and Events

      Is it possible to sync Zoho CRM calendar, task and events with Google Calendar's tasks and events. With the increasing adoption by many major tool suppliers to sync seamlessly with Google's offerings (for instance I use the excellent Any.do task planning
    • CRM Deluge how can link attach file with workdrive file.

      Hi, We have create file at workdrive and would like to link to attachment at crm module by deluge. Right now can only upload it to attachment but can not link the file from workdrive. Thank you
    • Feature announcement: AI-powered document generator in Zoho Sign

      Hi there! We recently announced manual document creation by offering an editor within Zoho Sign. Today, we are excited to announce AI-powered document generation to help you draft agreements, purchase orders, and other important business documents in
    • Permanently deleted files

      Is there a way to get back permanently deleted files from your account if they were accidentally deleted and no longer recoverable from the recycling bin? I know I am probably screwed but I just figured I would ask.
    • Shared Mailbox in iOS app

      Hi, On the desktop I am using a Shared mailbox for our company's general mailbox that somebody else should be able to view. In the iOS app however I can't find it? Old sources on the internet says this isn't possible but that can't be right? Somebody
    • Tip #41- Simplify Compliance and Efficiency with Zoho Assist’s Data Cleanup Feature- 'Insider Insights'

      Managing device data efficiently is just as important as securing remote access. With Zoho Assist’s Data Cleanup feature, admins can easily remove outdated or unnecessary device records, keeping the console organized and secure. This action is carried
    • Revenue Management: #6 Revenue Recognition in Professional Services Industry

      If you run a consulting firm, agency, or any service-based business, you have a situation where you have signed the contract, maybe even sent the invoice, and have received some initial payments. So, can you consider this as revenue? What if the project
    • This domain is not allowed to add. Please contact support-as@zohocorp.com for further details

      I am trying to setup the free version of Zoho Mail. When I tried to add my domain, theselfreunion.com I got the error message that is the subject of this Topic. I've read your other community forum topics, and this is NOT a free domain. So what is the
    • Zoho fsm scheduled maintenance dispatch

      Hi, I'm reaching out regarding an issue I'm encountering with the Scheduled Maintenance feature in Zoho FSM. I’m trying to configure it so that it automatically dispatches all maintenance jobs scheduled within the next 150 days, starting from today. However,
    • Template modifiactions

      Hello, I am struggling with the templates in ZOHO Books. Especially with the placement of some items, like company address, ship to, bill to etc.  For example: One item I like from template X (placement of ship to and bill to next to each other in the
    • zoho.inventory.getRecords returns no records

      I running a custom function (Deluge) in Zoho Flow with a connection to Zoho Inventory. To debug the problem, I created the test function below. It returns "Number of contacts fetched: 0". This confirms that there's no issue with the org ID or connection
    • Zoho Campaigns Event timestamps do not propagate to Zoho CRM

      We have integrated Zoho CRM and Zoho Campaigns. But when looking at Contact records, the Campaign event data is missing the actual timestamps: especially when a particular email was sent. They're not in the Campaigns related list, and the cannot be found
    • Feature announcement - Simplifying document creation with Zoho Sign

      Hi there, We are pleased to announce the release of our document creation feature, enabling you to create, edit, and finalize documents like agreements, purchase orders, and contracts without relying on external tools or applications. <br> This
    • Integrating File Attachments in Zoho Flow Email Notifications

      Hi, I would like to be able to send an email once an entry is made in a form, and in this email, I would like to attach a file that has been added to the form using the ImageUpload (or FileUpload) widget. So, I started by creating a flow that will trigger
    • CRM->INVENTORY, sync products as composite items

      We have a product team working in the CRM, as it’s more convenient than using Books or Inventory—especially with features like Blueprints being available. Once a product reaches a certain stage, it needs to become visible in Inventory. To achieve this,
    • Zoho Mail SMTP IP addresses

      We are using Zoho Mail and needs to whitelist IP for some redirections from your service to another e-mails. You can provide IP address list for Zohomail SMTP servers?
    • Zoho project purchases

      Hi Folks, I think having a purchase module in projects will help in putting together a project p and L. Project wise purchases and expenses.  Do let me know your thoughts.
    • Create Tasklist with Tasklist Template using API v3

      In the old API, we could mention the parameter 'task_template_id' when creating a tasklist via API to apply a tasklist template: https://www.zoho.com/projects/help/rest-api/tasklists-api.html#create-tasklist In API v3 there does not seem to be a way to
    • How can I restore all the deleted Time entries of a Task in Zoho Projects

      How can I restore all the deleted Time entries of a Task in Zoho Projects? Query: In Zoho Projects, I cloned a task and deleted the time entries from the cloned task. However, this also deleted the time entries from the original task. How can I restore
    • Is there a way to make an account inactive in ZoHo Desk

      We have a few Clients "Accounts" that we no longer do business with. It would be beneficial for them to not show up in lists. However, we want to go back and view tickets, time, etc.
    • How to set the value of the Phone field importing contacts in Zoho Desk

      Hi everyone, i'm new in Zoho Desk, we're setting up the environment and i'm importing contacts from another CRM using a file CSV and i'm getting a problem with phone numbers (italian): the leading zero is cut away, also if the value is inside double quotes.
    • Set Custom Icon for Custom Modules in new Zoho CRM UI

    • Change total display format in weekly time logs

      Hi! Would it be possible to display the total of the value entered in the weekly time log in the same format that the user input? This could be an option in the general settings -> display daily timesheet total in XX.XX format or XX:XX.
    • Deprecation Notice: OpenAI Assistants API will be shut down on August 26, 2026

      I recieved this email from openAI what does it means for us that are using the integration and what should we do? Earlier this year, we shared our plan to deprecate the Assistants API once the Responses API reached feature parity. With the launch of Conversations,
    • How to center a field inside a section?

      I’ve been trying to center a field inside a section in Zoho Canvas. When I align it visually, it looks centered in the editor, but after clicking Save, the field appears misaligned on the actual canvas. I also tried setting the field to full width, but
    • Kaizen #192 - Implementing Custom Token Persistence in Python SDK

      Welcome back to another week of Kaizen! Last week, we discussed how to implement Login with Zoho using OAuth 2.0 and saw how to bring it to life in a real-world application with the Zoho CRM Python SDK. We also discussed how Zylker Academy built a custom
    • Showing the map along with mileage expense

      When you use the GPS to track mileage, it shows you the map of the actual path travelled. It would be very useful and practical to save that map with the mileage expense, so that when the report is created, it provides a map of each mileage expense associated
    • Enable Validation Rule for Multi-Select Picklist Field

      Zoho, Please allow validation rules for multi-select fields.
    • File Upload field not showing in workflow

      Hi, I have added a field on Zoho CRM. I want to use it in a workflow where that particular field is updated based on another field, however it is not showing up in the field list to select it in the workflow. Why is this please?
    • CRM Custom function updating a module record shows the Super Admin user as the record modifier

      Dear Zoho CRM Team, Is there any way to update this so that when a custom function has updated a record the Super Admin user doesn't become the modifier? This happens on the record as a modifier and shows up in the audit logs. It would be more useful
    • Best practice importing items and matching assemblies

      Hi, I was wondering what would be the best practice to import items and composite items (assemblies) From my backup, what should I import first? The items or the composite items? I am on Zoho one, using inventory and books. Kind regards, Sabine
    • Best way to fetch employee names from Zoho People into Zoho Creator Inventory Stock Form field Employee Name Lookup

      Hi Team, I have a requirement in my Zoho Creator application (Inventory Stock Adjustment) where I need to fetch employee names from Zoho People and use them as a lookup in a form. Currently, I am considering using an integration field to fetch this data
    • get file api is returning Junk data

      I am working on extension development where at one point I need to retrieve attachments on records I found out I can use only invokeconnection and not invokeurl in extension development The invoke connection returns the image in raw binary format. When
    • Need help with message box

      End user updates many records at once. Each have unique serial number. They want a confirmation box that says starting number, ending number and qty. Is there any way to do this? I been searching and asking support but seems like no great solution.
    • [Webinar] The Transformative Power of Gen BI

      Traditional decision-making tools are no longer enough. The integration of generative AI into business intelligence (BI) is proving to be a true game changer—enabling businesses to make faster, smarter, and better informed decisions. Early adopters of
    • Backorder process review - Automating Removal of Sales Order from "On Hold" When PO is Received

      Hello Zoho Inventory Team, Currently, sales orders in On Hold status are released only when the bill for the purchase order is created. In our workflow, it would be much more efficient if the sales order could automatically move out of On Hold as soon
    • How to access the saved Query using API?

      I have created a query in setting. Is it possible to access it from a API? What's the endpoint? I tried /v8/queries/important_deals but didnt' work.
    • création d'une base de données

      base de donnee d'un lycée
    • Next Page