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

    • Constant color of a legend value

      It would be nice if we can set a constant color/pattern to a value when creating a chart. We would often use the same value in different graph options and I always have to copy the color that we've set to a certain value from a previous graph to make
    • Zoho Pagesense really this slow??? 5s delay...

      I put the pagesense on my website (hosted by webflow and fast) and it caused a 5s delay to load. do other people face similar delays?
    • Payroll and BAS ( Australian tax report format )

      Hello , I am evaluating Zoho Books and I find the interface very intuitive and straight forward. My company is currently using Quickbooks Premier the Australian version. Before we can consider moving the service we would need to have the following addressed : 1.Payroll 2.BAS ( business activity statement ) for tax purposes 3.Some form of local backup and possible export of data to a widely accepted format. Regards Codrin Mitin
    • Problem with Email an invoice with multiple attachments using API

      I have an invoice with 3 attachments. When I send an email manually using the UI, everything works correctly. I receive an email with three attachments. The problem occurs when I try to initiate sending an email using the API. The email comes with only
    • Page Layouts for Standard Modules like CRM

      For standard modules like quotes, invoices, purchase orders, etc, it would be a great feature to be able to create custom page layouts with custom fields in Zoho Books similar to how you can in Zoho CRM. For example, and my current use case, I have a
    • Non-depreciating fixed asset

      Hi! There are non-depreciable fixed assets (e.g. land). It would be very useful to be able to create a new type of fixed asset (within the fixed assets module) with a ‘No depreciation’ depreciation method. There is always the option of recording land
    • Fixed asset management

      I want to know if there is any individual module for fixed assets management
    • One time sale item in billing automatically detects as service

      if i have some items which i don't want to add in my "item" list because its sold only for one time. but when i type item name in invoice, it (system) automatically takes it as a service and despite of HSN , it shows SAC code to be entered. if its selectable i.e. either item or service , it would be very helpful and a must have feature.
    • Project template after project creation

      How can I apply a project template AFTER the project has been created?
    • convert the project to templet

      i have some deployment ME product for different customer , i need to create a fixed template for use it rather then keeping creating this template every time
    • Is there a notification API when a new note is addeding

      Trying to push to Cliq, or email notification when there's a new note added in module. How to implement this?
    • Seriously - Create multiple contacts for leads, (With Company as lead) Zoho CRM

      In Zoho CRM, considering a comapny as a lead, you need us to allow addition of more than one contact. Currently the Lead Section is missing "Add contact" feature which is available in "Accounts". When you know that a particular lead can have multiple
    • Related Module in Sharing Rules

      Zoho CRM team recently added the feature to filter records by Related Records It will be really beneficial if we can have this feature for Sharing Rules as well
    • Assignment Thresholds Resetting After Lead Conversion

      Hello everyone, We're facing an issue with Zoho CRM's lead assignment thresholds that makes them unsuitable for our workflow. I'm hoping to find a potential workaround or solution from the community. Here’s our current process: A new lead is created automatically
    • Zoho CRM Analytics - Allow To Reorder Dashboards

      I would like to suggest that you add the ability to reorder dashboards in the Analytics Module. I can see that this has been requested some time ago, the latest 9 years ago. I am not sure if this is a big or small endeavor, but such a small fix can go
    • Territory view for custom modules?

      I have recently activated territories however I can't seem to find how to use territories for custom modules? These modules have territories:  Contacts /  Accounts / Opportunities These modules don't have territories:   Buildings (custom module) and 
    • Zoho Books - How to Invoke a Custom Function in Schedulers

      We have multiple schedulers that send emails to customers in batches. Currently, we are maintaining the same code across several schedulers. Is it possible to use a custom function inside a scheduler script? If yes, how can we invoke the custom function
    • Approval Process Comments

      Is it possible to view the comments entered during the approval or rejection of a record in the approval process? If not, is there a way to require a field to be completed upon approval or rejection?
    • Login for test case

      Had a few questions regarding authentication test cases and couldn't find an answer in the the docs. 1. If an app like Zoho Creator requires authentication before providing access, do I need to create a login function and add it to each test case? 2.
    • Zoho / Outlook Calendar sync

      The current Marketplace -> Microsoft -> Meetings integration needs 2 changes. 1. The current language for the Two-Way sync option should be changed. It currently states, "Sync both your Zoho CRM Calendar and Office 365 Calendar meetings with each other."
    • Please make it easier to Pause syncing

      right now it takes 3 clicks to get there. sounds silly, but can you make it just 2 clicks to get it done instead? thats how dropbox does it, 2 clicks to pause instead of 3.
    • Customer members area

      Does FSM support a customer members area? If not what do you propose we use if we want the data used in FSM for customers to give them an area / login to see past orders, create new orders and general announcements.
    • Zoho Books-Accounting on the Go Series!

      Dear users, Continuing in the spirit of our 'Function Fridays' series, where we've been sharing custom function scripts to automate your back office operations, we're thrilled to introduce our latest initiative – the 'Zoho Books-Accounting on the Go Series'.
    • Desktop app doesn't support notecards created on Android

      Hi, Does anybody have same problem? Some of last notecards created on Android app (v. 6.6) doesn't show in desktop app (v. 3.5.5). I see these note cards but whith they appear with exclamation mark in yellow triangle (see screenshot) and when I try to
    • Notes created in mobile can no longer be accessed in desktop

      Working with a 2013 Mac running OS 10.14.6; Desktop Notebook version 4.5.3. Using Motorola Moto G Power 5G - 2024; Android app version 6.7 I have been using Notebook for some years. Starting several weeks ago, the notes newly created ion the phone can
    • Function #49: Manage varying installment payments using Zoho Books

      . Hello everyone, and welcome back to our series! Last week, we discussed automating the collection of fixed installment payments in Zoho Books. But what if your payment structure involves charging varying percentages of the invoice total as installments?
    • Open Sans Font in Zoho Books is not Open Sans.

      Font choice in customising PDF Templates is very limited, we cannot upload custom fonts, and to make things worse, the font names are not accurate. I selected Open Sans, and thought the system was bugging, but no, Open Sans is not Open Sans. The real
    • Zoho Writer - Option to Export as .zdoc format

      I've noticed that it's not possible to export a Zoho Writer Document in the .zdoc format. Isn't zdoc, Zoho Writer's own format? My use case is that I sometimes need to create quite complex documents with floating elements, which sometimes need to become
    • Is it possible for contacts to "Re-enter" a workflow in Zoho Campaign?

      We are currently working on a way to automatically add users to from one list to other lists based on specific criteria, but can't seem to find a native way of doing this so we are trying to use Workflows to do this. So, for example, if a user's status is set to "Active," then they should be added to the list "Active Users." If the same user's status is then set to "Paused," they should be added to the list "Paused Users" and removed from the list "Active Users." This works fine for the first go
    • Bulk upload images and specifications to products

      Hi, Many users have asked this over the years and I am also asking the same. Is there any way in which we can bulk upload product (variant) images and product specifications. The current way to upload/select image for every variant is too cumbersome.
    • Out of Office for Just One of My Alias Email

      Can I set up the Out of Office Reply for Just One of my Alias Email Addresses?
    • Can I map multiple Surveys into the CRM using the same fields?

      Hello, We are a healthcare practice that offers two distinct services (Nutrition and Primary Care). We use Zoho Survey for our lead generation form (Get Started Survey), which allows people to express interest in one of the two services and even allows
    • Dealing with API responses where integers have more than 16 digits

      Hi there How do I deal with an api response contaning an int or float with more than 16 digits (before any decimal places for a float). I constantly receive the response "Unable to cast the 'BigInteger' value into a 'BIGINT' value because the input is
    • To Zoho customers and partners: how do you use Linked Workspaces?

      Hello, I'm exploring how we can set up and use Linked Workspaces and would like to hear from customers and partners about your use cases and experience with them. I have a Zoho ticket open, because my workspace creation fails. In the meantime, how is
    • Can't change form's original name in URL

      Hi all, I have been duplicating + editing forms for jobs regarding the same department to maintain formatting + styling. The issue I've not run into is because I've duplicated it from an existing form, the URL doesn't seem to want to update with the new
    • Need Inactive accounts to be visible in Reports in Zoho Books

      I N=need Inactive accounts to be visible in Reports in Zoho Books to do recons of the accounts but when i see the same they are not visible in the Accountant - Account Transactions report
    • unblock e-mail

      please unblock my e-mails info@meatnews.gr and myrtokaterini@meatnews.gr
    • Add Zoho Mail for users who do not need Zoho One

      We have licenses for ZOho One for teams that need to use the suite of products that Zoho One offers.  We have 8 more people who only need email access and we would like to add just a Zoho Mail.  They do not need the Zoho One license.  We are currently
    • Zoho Projects - Q2 Updates | 2025

      Hello Users, With this year's second quarter behind us, Zoho Projects is marching towards expanding its usability with a user-centered, more collaborative, customizable, and automated attribute. But before we chart out plans for what’s next, it’s worth
    • ZML vs HTML Snippet - which is better?

      Are there certain use cases where one is better than the other?
    • Next Page