Zoho Books: Please ensure that the "description" has less than 100 characters.

Zoho Books: Please ensure that the "description" has less than 100 characters.

I have this code written to convert Quote into an invoice and keep getting an error even while saving the code. 

Error: Please ensure that the "description" has less than 100 characters.

  1. // Replace with your actual organization ID and connection name
  2.     org_id = "7004318259";
  3.     connection_name = "zohobooks";

  4.     // Fetch the quote details using the provided quote_id
  5.     quote_response = zoho.books.getRecordsByID("Estimates", org_id, quote_id, connection_name);
  6.     estimate = quote_response.get("estimate");

  7.     if (estimate.isEmpty())
  8.     {
  9.         info "Quote not found for ID: " + quote_id;
  10.         return;
  11.     }

  12.     // Extract key details from the quote
  13.     customer_id = estimate.get("customer_id");
  14.     zcrm_potential_id = estimate.get("zcrm_potential_id");
  15.     if(zcrm_potential_id != "" && zcrm_potential_id != null)
  16.     {
  17.         deals = zoho.crm.getRecordById("Deals",zcrm_potential_id);
  18.         What_type_of_job_is_this = deals.get("What_type_of_job_is_this");
  19.     }
  20.     estimate_id = estimate.get("estimate_id");
  21.     estimate_number = estimate.get("estimate_number");
  22.     currency_id = estimate.get("currency_id");
  23.     line_items = estimate.get("line_items");

  24.     // Initialize lists to hold Supply and Installation items
  25.     if(What_type_of_job_is_this == "Mixed Scope (Supply + Install)")
  26.     {
  27.         supply_items = List();
  28.         installation_items = List();

  29.         // Filter line items based on Item Category
  30.         for each  item in line_items
  31.         {
  32.             // Access the custom field "Item Category"
  33.             custom_fields = item.get("item_custom_fields");
  34.             item_category = "";
  35.             for each  cf in custom_fields
  36.             {
  37.                 if(cf.get("label") == "Item Category")
  38.                 {
  39.                     item_category = cf.get("value");
  40.                     break;
  41.                 }
  42.             }

  43.             // Create an item map for invoice creation, including tax
  44.             item_map = Map();
  45.             item_map.put("item_id",item.get("item_id"));
  46.             item_map.put("quantity",item.get("quantity"));
  47.             item_map.put("rate",item.get("rate"));
  48.             item_map.put("tax_id",item.get("tax_id"));
  49.             // Include tax ID (e.g., GST)
  50.             description = item.get("description");
  51.             if(description.length() > 100)
  52.             {
  53.                 description = description.subString(0,100); // Truncate to 100 characters
  54.             }
  55.             item_map.put("description",description);
  56.             // Optional: from quote, limited to 100 characters
  57.             item_map.put("unit",item.get("unit"));
  58.             // Optional: from quote

  59.             if(item_category.equalsIgnoreCase("Supply"))
  60.             {
  61.                 supply_items.add(item_map);
  62.             }
  63.             else if(item_category.equalsIgnoreCase("Installation"))
  64.             {
  65.                 installation_items.add(item_map);
  66.             }
  67.         }

  68.         // Prepare common invoice details
  69.         current_date = today;
  70.         current_date = current_date.toString("yyyy-MM-dd");
  71.         // Format for API
  72.         due_date = addDay(current_date,30).toString("yyyy-MM-dd");

  73.         // API URL for Zoho Books Invoices endpoint
  74.         base_url = "https://www.zohoapis.com.au/books/v3/invoices?organization_id=" + org_id;

  75.         // Create Supply Invoice if there are Supply items
  76.         if(!supply_items.isEmpty())
  77.         {
  78.             supply_invoice_map = Map();
  79.             supply_invoice_map.put("customer_id",customer_id);
  80.             supply_invoice_map.put("currency_id",currency_id);
  81.             supply_invoice_map.put("date",current_date);
  82.             supply_invoice_map.put("due_date",due_date);
  83.             supply_invoice_map.put("line_items",supply_items);
  84.             supply_invoice_map.put("reference_number","SUP-" + estimate_number);
  85.             supply_invoice_map.put("notes",estimate.get("notes"));
  86.             supply_invoice_map.put("terms",estimate.get("terms"));
  87.             supply_invoice_map.put("invoiced_estimate_id",estimate_id);
  88.             // Link to estimate
  89.             supply_invoice_map.put("zcrm_potential_id",zcrm_potential_id);
  90.             // CRM deal link
  91.             supply_invoice_map.put("ignore_auto_number_generation",false);
  92.             // Auto-generate invoice number
  93.             supply_invoice_map.put("is_inclusive_tax",false);
  94.             // Match your sample
  95.             supply_invoice_map.put("discount",0);
  96.             // From quote
  97.             supply_invoice_map.put("shipping_charge",0);
  98.             // From quote
  99.             supply_invoice_map.put("adjustment",0);
  100.             // From quote

  101.             // Convert map to JSON string for API
  102.             parameters_data = supply_invoice_map.toString();

  103.             // Invoke URL to create Supply Invoice
  104.             response = invokeurl
  105.             [
  106.                 url :base_url
  107.                 type :POST
  108.                 parameters:parameters_data
  109.                 connection:"zohobooks"
  110.             ];
  111.             info response;
  112.         }

  113.         // Create Installation Invoice if there are Installation items
  114.         if(!installation_items.isEmpty())
  115.         {
  116.             installation_invoice_map = Map();
  117.             installation_invoice_map.put("customer_id",customer_id);
  118.             installation_invoice_map.put("currency_id",currency_id);
  119.             installation_invoice_map.put("date",current_date);
  120.             installation_invoice_map.put("due_date",due_date);
  121.             installation_invoice_map.put("line_items",installation_items);
  122.             installation_invoice_map.put("reference_number","INST-" + estimate_number);
  123.             installation_invoice_map.put("notes",estimate.get("notes"));
  124.             installation_invoice_map.put("terms",estimate.get("terms"));
  125.             installation_invoice_map.put("invoiced_estimate_id",estimate_id);
  126.             // Link to estimate
  127.             installation_invoice_map.put("zcrm_potential_id",zcrm_potential_id);
  128.             // CRM deal link
  129.             installation_invoice_map.put("ignore_auto_number_generation",false);
  130.             // Auto-generate invoice number
  131.             installation_invoice_map.put("is_inclusive_tax",false);
  132.             // Match your sample
  133.             installation_invoice_map.put("discount",0);
  134.             // From quote
  135.             installation_invoice_map.put("shipping_charge",0);
  136.             // From quote
  137.             installation_invoice_map.put("adjustment",0);
  138.             // From quote

  139.             // Convert map to JSON string for API
  140.             parameters_data = installation_invoice_map.toString();

  141.             // Invoke URL to create Installation Invoice
  142.             response = invokeurl
  143.             [
  144.                 url :base_url
  145.                 type :POST
  146.                 parameters:parameters_data
  147.                 connection:"zohobooks"
  148.             ];
  149.             info response;
  150.         }
  151.     }
  152.     else
  153.     {
  154.         supply_items = List();

  155.         // Create an item map for invoice creation, including tax
  156.         for each  item in line_items
  157.         {
  158.             // Create an item map for invoice creation, including tax
  159.             item_map = Map();
  160.             item_map.put("item_id",item.get("item_id"));
  161.             item_map.put("quantity",item.get("quantity"));
  162.             item_map.put("rate",item.get("rate"));
  163.             item_map.put("tax_id",item.get("tax_id"));
  164.             // Include tax ID (e.g., GST)
  165.             description = item.get("description");
  166.             if(description.length() > 100)
  167.             {
  168.                 description = description.subString(0,100); // Truncate to 100 characters
  169.             }
  170.             item_map.put("description",description);
  171.             // Optional: from quote, limited to 100 characters
  172.             item_map.put("unit",item.get("unit"));
  173.             supply_items.add(item_map);
  174.         }

  175.         // Prepare common invoice details
  176.         current_date = today;
  177.         current_date = current_date.toString("yyyy-MM-dd");
  178.         // Format for API
  179.         due_date = addDay(current_date,30).toString("yyyy-MM-dd");

  180.         // API URL for Zoho Books Invoices endpoint
  181.         base_url = "https://www.zohoapis.com.au/books/v3/invoices?organization_id=" + org_id;

  182.         // Create Supply Invoice if there are Supply items
  183.         supply_invoice_map = Map();
  184.         supply_invoice_map.put("customer_id",customer_id);
  185.         supply_invoice_map.put("currency_id",currency_id);
  186.         supply_invoice_map.put("date",current_date);
  187.         supply_invoice_map.put("due_date",due_date);
  188.         supply_invoice_map.put("line_items",supply_items);
  189.         supply_invoice_map.put("reference_number",estimate_number);
  190.         supply_invoice_map.put("notes",estimate.get("notes"));
  191.         supply_invoice_map.put("terms",estimate.get("terms"));
  192.         supply_invoice_map.put("invoiced_estimate_id",estimate_id);
  193.         // Link to estimate
  194.         supply_invoice_map.put("zcrm_potential_id",zcrm_potential_id);
  195.         // CRM deal link
  196.         supply_invoice_map.put("ignore_auto_number_generation",false);
  197.         // Auto-generate invoice number
  198.         supply_invoice_map.put("is_inclusive_tax",false);
  199.         // Match your sample
  200.         supply_invoice_map.put("discount",0);
  201.         // From quote
  202.         supply_invoice_map.put("shipping_charge",0);
  203.         // From quote
  204.         supply_invoice_map.put("adjustment",0);
  205.         // From quote

  206.         // Convert map to JSON string for API
  207.         parameters_data = supply_invoice_map.toString();

  208.         // Invoke URL to create Supply Invoice
  209.         response = invokeurl
  210.         [
  211.             url :base_url
  212.             type :POST
  213.             parameters:parameters_data
  214.             connection:"zohobooks"
  215.         ];
  216.         info response;
  217.     }
    • Recent Topics

    • Shared values: From classroom lessons to teaching moments in customer service

      While the world observes Teachers’ Day on October 5, in India, we celebrate a month earlier, on September 5, to mark the birth anniversary of Dr. Sarvepalli Radhakrishnan, a great teacher, renowned scholar, educationist, and advocate for empowerment.
    • Export to excel stored amounts as text instead of numbers or accounting

      Good Afternoon, We have a quarterly billing report that we generate from our Requests. It exports to excel. However if we need to add a formula (something as simple as a sum of the column), it doesn't read the dollar amounts because the export stores
    • Create a list of customers who participated in specific Zoho Backstage events and send them an email via Zoho CRM

      How to create a list of customers who participated in specific Zoho Backstage events and send them an email via Zoho CRM? I was able to do a view in CRM based on customer that registered to an event, but I don't seems to be able to include the filter
    • Zoho Desk blank page

      1. Click Access zoho desk on https://www.zoho.com/desk/ 2. It redirects to https://desk.zoho.com/agent?action=CreatePortal and the page is blank. Edge browser Version 131.0.2903.112 (Official build) (arm64) on MacOS
    • I hate the new user UI with the bar on the left

      How can I reverse this?
    • 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
    • Question regarding import of previous deals...

      Good afternoon, I'm working on importing some older deal records from an external sheet into the CRM; however, when I manually click "Add New Deal" and enter the pertinent information, the deal isn't appearing when I look at the "Deals" bar on the account's
    • Client Script also planned for Zoho Desk?

      Hello there, I modified something in Zoho CRM the other day and was amazed at the possibilities offered by the "Client Script" feature in conjunction with the ZDK. You can lock any fields on the screen, edit them, you can react to various events (field
    • One person/cell phone to manage multiple accounts

      Hi. I have a personal Free account to keep my own domain/emails. Now I need to create a Business account to my company's own domain, but I have only one mobile phone number I use to everything. How do I do to manage this? Can I manage a Free domain and
    • Tracking KPIs, Goals etc in People

      How are Zoho People users tracking employee targets in People? For example, my marketing assistant has a target of "Collect 10 new customer testimonials every month". I want to record attainment for this target on a monthly basis, then add it to their
    • Zoho Desk: Ticket Owner Agents vs Teams

      Hi Zoho, We would like to explore the possibility of hiding the ‘Agents’ section within the Ticket Owner dropdown, so that we can fully utilise the ‘Teams’ dropdown when assigning tickets. This request comes from the fact that only certain agents and
    • Can not Use Attachment Button on Android Widget

      this always pops up when I touch the attach button on android widget. going to settings, there is no storage permission to be enabled. if I open the app, and access the attach feature there, I can access my storage and upload normally.
    • Zoho Notebook Sync problem

      I'm facing a problem with syncing of notebook on android app. It's not syncing. Sometimes it syncs after a day or two.  I created some notes on web notebook but it's not syncing on mobile app. Please help!!!!
    • Custom Fonts in Zoho CRM Template Builder

      Hi, I am currently creating a new template for our quotes using the Zoho CRM template builder. However, I noticed that there is no option to add custom fonts to the template builder. It would greatly enhance the flexibility and branding capabilities if
    • Announcing new features in Trident for Mac (1.24.0)

      Hello everyone! Trident for macOS (v.1.24.0) is here with interesting features and thoughtful enhancements to redefine the way you plan and manage your calendar events. Here's a quick look at what's new. Create calendar events from emails. In addition
    • Need Easy Way to Update Item Prices in Bulk

      Hello Everyone, In Zoho Books, updating selling prices is taking too much time. Right now we have to either edit items one by one or do Excel export/import. It will be very useful if Zoho gives a simple option to: Select multiple items and update prices
    • Vendor Master Enhancements for Faster Purchase Entry

      I’d like to suggest a few features that will improve accuracy and speed during purchase voucher entry: Automated Item Tax Preference in Vendor Master Add an option to define item tax preference in the vendor master. Once set, this preference should automatically
    • Mass Mail Statistics - Number of unsent emails

      How do I find out which emails were not sent?
    • Button to add product to cart

      Is there a way to have a button on a page, that when clicked, will add Qty 1 of a product to the cart?
    • Est-il possible d'annuler l'envoi d'un mail automatique ?

      Bonjour, Lorsque je refuse un candidat, il reçois un mail dans les 24h pour l'informer que sa candidature n'est pas retenue. J'ai rejeté un candidat par erreur. Savez-vous s'il possible d'annuler l'envoi de ce mail ? Merci d'avance pour votre aide.
    • 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
    • New in Cadences: Option to Resume or Restart follow-ups when re-enrolling records into a Cadence, and specify custom un-enrollment criteria

      Managing follow-ups effectively involves understanding the appropriate timing for reaching out, as well as knowing when to take a break and resume later, or deciding if it's necessary to start the follow-up process anew. With two significant enhancements
    • embed a form in an email

      Hello, how to embed a form in an email that populates Zoho CRM cases? I would like to send emails to a selected audience offering something. In the same email the recipients - if interested - instead of replying to can fill in a Zoho CRM form that creates
    • Zoho Bookings - Reserve with Google

      Does Zoho Bookings plan to to integrate with Reserve with Google?
    • How to add Zoho demo site page designs to my Zoho Sites website

      Hi, I would like to add the design from the following demo URLs into my current Zoho website. I have already created two new pages on my site, named “Menu2” and “Menu3.” For the “Menu2” page, I want to use the design from this demo: https://naturestjuice-demo.zohosites.com/menu
    • Digest Août - Un résumé de ce qui s'est passé le mois dernier sur Community

      Bonjour chère communauté ! Voici le résumé tant attendu de tout ce qui a marqué Zoho le mois dernier : contenus utiles, échanges inspirants et moments forts. 🎉 Découvrez Zoho Backstage 3.0 : une version repensée pour offrir encore plus de flexibilité,
    • Global Sets for Multi-Select pick lists

      When is this feature coming to Zoho CRM? It would be very useful now we have got used to having it for the normal pick lists.
    • Text snippet

      There is a nice feature in Zoho Desk called Text Snippet. It allows you to insert a bit of text anywhere in a reply that you are typing. That would be nice to have that option in Zoho CRM as well when we compose an email. Moderation Update: We agree that
    • Kaizen #206 - Answering your Questions | Displaying Related Purchase Orders from Zoho Books in CRM Deals using Queries

      Hello everyone! We're back with another post in the Kaizen series. We're grateful for the feedback we received from all of you! One of the questions we received was "I would like to see the list of Purchase Orders in Zoho Books for a Deal in CRM." We
    • Add Analytics function for Title case (capitalising each word in a string)

      At present, you can only capitalise each word in a string in Analytics during data import. It would be really useful to be able to do this with a formula column, but there is no Title Case function.
    • How to conditionally embed an own internal widget with parameters in an html snippet?

      Hello everyone, I'm trying to create a dynamic view in a page using an HTML snippet. The goal is to display different content based on a URL parameter (input.step). I have successfully managed to conditionally display different forms using the following
    • Introducing AI-powered Assessments & Zoho's native LLM, Zia

      We’ve shipped a cleaner, faster way to create assessments in Zoho Recruit. 🚀 Instead of manually building question banks or copying old templates, you can now generate ready-to-use assessments in just a few clicks, all tailored to the role you’re hiring
    • Sync more than one Workdrive

      Hello Please I'm facing some difficulties since some days. In my company we have many zoho accounts in different organisations. And I have to find a way to sync all these Workdrives. I spend many hours to search it on zoho Workdrive but no solution. Could someone help me ? Any idea how I can achieve it ? Thanks in advance. Regards
    • Zoho writer unable to merge documents to PDF with basic fonts in Hebrew or fonts from my computer

      I created several forms that will be merged into PDF files through Zoho Writer and I am unable to receive the PDF in the basic fonts of the Hebrew language or in the fonts I have on my computer. The writer exports to PDF an exchange font that looks very
    • Base Currency Adjustment Reversal

      Two questions surrounding the base currency adjustments (BCA). I recently ported over from QB so I need to enter the base currency adjustments. In QB, it will calculate the BCA for you at the end of the year and then reverse it at the top of the following year. Makes sense. Does Zohobooks not do this as well? I created a BCA for Dec 31, 2016 but no reversing entry was made Jan 1, 2017. Am I supposed to manually do a reversal? I'm not even allowed to post journals directly to the 'exchange gain loss'
    • Please implement UAE Central Bank FX rates

      Hello, as I understand from your knowledge base, any UAE business account created from September 15, 2018 does not have foreign exchange rates fetched automatically. This is a serious inconvenience and I am not sure why ZOHO has not looked into the ways
    • Unable to enable tax checkboxes

      Hi Zoho Commerce Support, I'm writing to report an issue I'm having with the tax settings in my Zoho Commerce store. I've created several tax rates under Settings > Taxes, but all of them appear with the checkbox disabled. When I try to enable a checkbox,
    • Search Records returning different values than actually present

      Hey! I have this following line in my deluge script: accountSearch = zoho.crm.searchRecords("Accounts","(RS_Enroll_ID:equals:" + rsid + ")",1,200,{"cvid":864868001088693817}); info "Account search size: " + accountSearch.size(); listOfAccounts = zoho.crm.searchRecords("Accounts","(RS_Enroll_ID:equals:"
    • Making digital signatures accessible to all: Introducing accessibility controls in Zoho Sign

      Hi there! At Zoho Sign, we are committed to building an inclusive digital experience for all our users. As part of our ongoing efforts to align with Web Content Accessibility Guidelines (WCAG), we’re updating the application with support that will go
    • Super Admin Access to All Courses and Spaces in Zoho Learn

      Dear Zoho Learn Team, We hope this message finds you well. We are using Zoho Learn extensively for internal and agent training. While managing our courses and spaces, we encountered a significant limitation regarding admin access and course management.
    • Next Page