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

    • Access Denied

      I am iOS Developer and updating our clients project and shifted ZohoDeskPortalCore SDKs from cocoapods to SPM and changed few lines of code but now i am get access denied, the help center app is unavailable. please contact administrator.
    • Using Zoho Desk to support ISMS process

      Hi, I am evaluating using Zoho Desk for security incident management. This seems to be aligned with Zoho Desk purpose as its just another type of incident. However in security incident management, ideally I can link incidents (tickets) with a risk from
    • Bin Locations

      Dear all, I am wondering if someone has the ability to develop the bin locations option for zoho inventory (integrated with zoho books) Regards, Ryan
    • TaxJar vs Avalara

      Hi, I'm evaluating adoption of a sales-tax service for US based business. Anyone else have experience with TaxJar and Zoho Books? I am a Zoho One subscriber so anticipate needing to use Flow to make this work. It seems like Avalara are simply too expensive
    • How to check Leads with no Task (open activity)

      Hi everyone, I was wondering if there’s a way to view leads that don’t have any tasks assigned or open activities linked to them.
    • What can we do on our end to improve the Answer bot answers?

      Hi, I'm using the Answer bot card in the Codeless bot builder. I've input several questions and their answers in the FAQ section to feed the Answer bot. The text is all in French, as this is the language our customers communicate in. I've tried testing
    • Taxes for EU B2B Transactions

      Currently, ZC doesn't seem to have a procedure for validating VAT numbers of businesses purchasing in another EU state, and removing local VAT is valid.  This is essential for all inter EU B2B trade.
    • How to upload file to Connect using API?

      Hi there. I looked at the API documentation and nowhere did it mention how to use the API method to upload a file even though it is mentioned that it is possible to be done so. Please help.
    • Group Tax in Service Line Items

      Hi FSM Team! I noticed that when you update a tax in the service line item the group tax is not showing up as an option. Let me know what can be done thank you!
    • FSM Improvement Idea - Show an Import button when there is no data

      I am setting up FSM for a client and I noticed that there is no option to import data, see screenshot below. Even when you click Create Contact there is only an option to Import from Zoho Invoice. It is only after you add at lease 1 record that the Import
    • Zoho FSM API Delete Record

      Hi FSM Team, It would be great if you could delete a record via API. Thank you,
    • OAUTH_SCOPE_MISMATCH Error for Marketing Automation APIs with CRM Plus Account

      I'm trying to integrate Marketing Automation journey triggering via API but getting OAUTH_SCOPE_MISMATCH errors. I need clarification on API access for CRM Plus users.
    • Access token generate from the refresh token not working for API

      Dear Sir/Madam, When I use my refresh token to obtain new access_token, that token return INVALID_TOKEN when the same API is called. I made sure that my api site is correct and match the auth web site. However the original access_token work fine.
    • Function #4: Schedule Customer Statements

      Regularly sending statements to customers is an imperative part of many business processes as it helps foster strong customer relationships and provides timely guidance on payments. While you can generate the statement of accounts and have it sent over
    • Limiting search or dependencies with an asterisk "*".

      I have a form with several dependency fields with options still developing for each field. Since these options were developing and not yet ready to be a selection in the field, I placed a filter for the dropdown field. In this filter, I selected fields
    • Cross Data Center Support for 1:1 Chats with External Users

      Hello Zoho Cliq Team, We hope you're doing well. We appreciate the recent enhancement that enables cross data center collaboration in external channels, which has already improved communication across distributed teams. However, we’ve noticed that this
    • Handling Greetings/Small Talk at the Beginning of a Zobot Conversation

      Hello everyone, I’m currently configuring a **Zobot** in Zoho SalesIQ and everything is working as expected, except for one specific scenario at the very beginning of the conversation. My target audience has the habit of starting with a **greeting or
    • Regex in Zoho Mail custom filters is not supported - but it works!

      I recently asked Zoho for help using regex in Zoho Mail custom filters and was told it was NOT supported. This was surprising (and frustrating) as regex in Zoho Mail certainly works, although it does have some quirks* To encourage others, here are 3 regex
    • Importing a new list into campaigns

      I'm in the middle of switching my email platform to campaigns. I have a list that I want to import, and it overlaps with my existing Zoho CRM list. The fields in my Zoho CTM are more robust. Will this new list that I upload into my campaigns overwrite
    • when I email a invoice how can i see it was sent and also were i can go to see all emails sent

      when I email a invoice how can i see it was sent and also were i can go to see all emails sent?
    • How can I see content of system generated mails from zBooks?

      System generated mails for offers or invices appear in the mail tab of the designated customer. How can I view the content? It also doesn't appear in zMail sent folder.
    • CRM Blueprint Notification by Cliq

      Dear Zoho team, In Workflow, there is nofication by cliq, but in blueprint, there is no option as cliq notification. I think it is very convenient to get notified by Cliq , as there are multi modules in apps, but we will always check Cliqs
    • Zoho People Attendance Regularization – Wrong Total Hours Displayed

      While using Zoho People, I observed that the attendance regularization is showing wrong total hours when applied to past dates. For example, if a check-in is added at 10:00 AM and check-out at 6:00 PM for a previous date, the system sometimes calculates
    • Sync Contacts in iOS

      What does the "Sync Contacts" feature in the iOS Zoho Mail app do?
    • Live webinar: Craft the ideal sales pitch deck with Show

      Every great sale starts with a great story. And your pitch deck? That’s where the story takes shape. But too often, these presentations end up looking generic, overloaded with text, or lacking structure. The good news is, it's easier to fix than you think!
    • Project Statuses

      Hi All, We have projects that sometimes may not make it through to completion. As such, they were being marked as "Cancelled". I noticed that these projects still show as "Active" though which seems counter intuitive. In fact, the only way I can get them
    • 👋 Welcome to the Zoho MCP Community

      Hello all, glad to have you here! This is your space for everything AI agents, MCP tools, and intelligent business apps. This community is for you — developers, partners, creators, and businesses exploring how agents can transform work. Whether you’re
    • DNS Manager

      Where Can I find my DNS manager so I can link this to click funnels or AWEBER
    • Forwarder

      Hi, I tried to add a forwarder from which emails are sent to my main zoho account email . However, it asks me for a code that should be received at the forwarder email, which is still not activated to send to my zoho emial account. So how can I get the
    • Forwarder

      Hi, I tried to add a forwarder from which emails are sent to my main zoho account email . However, it asks me for a code that should be received at the forwarder email, which is still not activated to send to my zoho emial account. So how can I get the
    • How do I sync multiple Google calendars?

      I'm brand new to Zoho and I figured out how to sync my business Google calendar but I would also like to sync my personal Google calendar. How can I do this so that, at the very least, when I have personal engagements like doctor's appointments, I can
    • Need to extract date from datetime field

      I have a datetime field and need only the date part from it. I am unable to find a built-in function that would be <DateTime>.Date(). I don't think I want to go the string conversion route of converting the datetime to string and then parsing out values and create a date out of it. Any one out there has a better solution to this? Thanks in adavnce. Regards Moiz Tankiwala Smart Training & IT Solutions
    • New in Cadences: WhatsApp follow-ups, upgraded limits, and options for add-ons

      Hello everyone, We're rolling out two key updates to help you engage better and scale smarter with Cadences in Zoho CRM. Reach customers on WhatsApp, directly from Cadences Previously, Cadences have enabled you to automate follow-ups through emails, calls,
    • additional accounts

      If I brought 5 emails to my account. Can I later buy additional emails.
    • Issue in Zoho People Regularization – Incorrect Hour Calculation

      I have noticed that when applying attendance regularization in Zoho People for previous dates, the total working hours are not calculated correctly. For example, even if the check-in is 10:00 AM and check-out is 6:00 PM, the system shows an incorrect
    • Why I am unable to configure Zoho Voice with my Zoho CRM account?

      I have installed Zoho Voice in my Zoho CRM, but as per the message there is some config needed in Zoho Voice interface. But when I click on the link given in the above message, I get an access denied page.
    • Issue with Hour Calculation in Zoho People Attendance Module

      I have noticed an issue in the attendance regularization feature of Zoho People. When trying to regularize past dates, the total working hours are not calculated correctly. For example, if I enter a check-in and check-out time for a previous day, the
    • Cliq Meeting Calls No Audio and Screen Share

      When in a Cliq channel meeting, the audio does not work at all on pc. When i use my phone as audio source, screen share on pc does not work. I have updated audio drivers but the strangest thing is that during a 1 on 1 call, it works well. Therefore the
    • Work anniversary and birthdays on connect

      Hello, I like the idea of having employee's work anniversary and birthdays on the dashbaord. Do you have to have the employee complete this information themselves in connect settings, or does it pull from their directory settings? (ie. we use Zoho one
    • Alias Email Id already exists

      Hi I'm trying to create an alias : contact @ yoavarielevy.co.il but i get the message  Alias Email Id already exists I had an account with the same name but I deleted it. Can you help? Thanx Yoav
    • Next Page