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

    • Commerce Order as Invoice instead of Sales Order?

      I need a purchase made on my Commerce Site to result in an Invoice for services instead of a Sales Order that will be pushed to Books. My customers don't pay until I after I add some details to their transaction. Can I change the settings to make this
    • Import data into Multi-Select lookup field from CSV/Excel

      How to import data into a multi-select lookup field from the CSV/Excel Sheet? Let's say I have an Accounts multi-select lookup field in the Deals module and I want to import the Deals with Accounts field. Steps:- 1. Create/edit a multi-select lookup field
    • Sync desktop folders instantly with WorkDrive TrueSync (Beta)

      Keeping your important files backed up and accessible has never been easier! With WorkDrive desktop app (TrueSync), you can now automatically sync specific desktop folders to WorkDrive Web, ensuring seamless, real-time updates across devices. Important:
    • Script that deletes a record?

      We're using WP Plugin "Integration for WooCommerce and Zoho Pro", and have created a couple of Feeds to send data to Zoho. We are trying to create Contact records, but only based upon condition. Tried to make it with small Deluge function and Workflow,
    • A formula that capitalises the first letter of each word

      Hi all, is there a zoho formula that can capitalise the first letter of each word in a string? INITCAP only capitalises the first letter of the first word.
    • Quotes in Commerce?

      In Zoho Ecommerce, I need to be able to generate quotes, negotiate with customers, and then generate invoices. Currently, I plan to integrate Zoho CRM to generate quotes. After negotiation and confirmation, I will push the details to Zoho Ecommerce to
    • Zoho Commerce - Mobile Application

      Does Zoho Commerce have a mobile application for customers to place an order?
    • Register user through Phone Number by Generating OTP

      In zoho commerce , I am developing website on online food store Inilialy the user get verification code to their email for registering there account for login. But I need to login using phone number by generating OTP automatically rather than verification
    • Unable to change sales_order status form "not_invoiced" to "invoiced"

      I am automating process of creating of invoice from sales_orders by consolidated sales_orders of each customer and creating a single invoice per customer every month. I am doing this in workflow schedule custom function where i create invoice by getting
    • Custom Buttons for Mass Actions

      Hello everyone, We’ve just made Custom Buttons in Zoho Recruit even more powerful! You can now create Bulk Action Buttons that let you perform actions on multiple records at once, directly from the List View. What’s new? Until now, custom buttons were
    • Zoho Vault Passwords

      Is there a way to consume Zoho Vault Manager passwords using the API? Thanks in advance.
    • Is the ChatGPT Assistant integration capable of recognizing WhatsApp voice messages?

      I was wondering: if a visitor sends me a voice message on WhatsApp, would the assistant be able to transcribe it and reply to them?
    • Zoho Creator to Zoho CRM Images

      Right now, I am trying to setup a Notes form within Zoho Creator. This Notes will note the Note section under Accounts > Selected Account. Right now, I use Zoho Flow to push the notes and it works just fine, with text only. Images do not get sent (there
    • 【Zoho CRM】レポート機能のアップデート

      ユーザーの皆さま、こんにちは。コミュニティチームの藤澤です。 今回は「Zoho CRM アップデート情報」の中から、レポート機能のアップデートをご紹介します。 目次 1. レポートのエクスポート時のレコードIDの表示について 2. 通貨項目の表示について 3. レポートの削除の監査ログへの反映について 1. レポートのエクスポート時のレコードIDの表示について これまで、レポートをエクスポートするとファイルにレコードIDが必ず含まれていました。レコードIDが識別子として役立つ場合もありますが、実際には多くの企業で参照されることはありません。
    • Translation in zoho bookings

      We cant translate zoho booking emails. The general text we can change. But what about text like: ""Here a link to join the meeting online:"" and "Add to Zoho Calendar" and "Add to Google Calendar"? No professional business have mixed languages. Its looking
    • Is there any way to bill one client in different currencies on different invoices?

      I have some customers who have their currency set as USD and most of their billing is done in USD.   However, from time to time I have a need to bill them in my base currency GBP for some specific invoices, but there seems to be no way of doing this that I can see. The only workaround that I can see is to create two client records for the same client, one for USD billing and one for GBP billing, but this is not an ideal situation. Is it likely that the (hopefully!) soon to arrive multi-currency support
    • API name for all fields in Zoho Project (Standard or custom)

      Hi! I struggle to find easily all API name of all field in Zoho Project to build my API rest with other services. We can find them very fast in CRM but not in PRoject.   Could you share a function to get the list of all API Name of any field of an App
    • Disappearing Mouse cursor in Zoho Mail / Windows 11 (Chrome + Edge)

      I'm seeing an issue when writing mails with the light theme with the mouse cursor being white and the document area also being white - making it nearly impossible to see the mouse cursor. I see the problem on Windows 11 under Chrome and Edge. (Yet to
    • Zoho Assist not rendering NinjaTrader chart properly

      Hi everyone. Just installed and testing Zoho Assist. I want to display my laptop' screen (Windows 11) on a monitor connected to my Mac mini. The laptop is running a stock trading program called NinjaTrader. Basically, when running, this program displays
    • Dropshipping Address - Does Not Show on Invoice Correctly

      When a dropshipping address is used for a customer, the correct ship-to address does not seem to show on the Invoice. It shows correctly on the Sales Order, Shipment Order, and Package, just not the Invoice. This is a problem, because the company being
    • Best way to schedule bill payments to vendors

      I've integrated Forte so that I can convert POs to bills and make payments to my vendors all through Books. Is there a way to schedule the bill payments as some of my vendors are net 30, net 60 and even net 90 days. If I can't get this to work, I'll have
    • Link(s) between Notes

      Hello Everyone, It would be great if links could be created between notes. Let's say we have 5 Notes A, B, C , D, E. I would like to be able to link Note A to Note B but not in other way, so no link appears in Note B linking to Note A. An so on, linking
    • Option to Hide Project Overview for Client Profiles

      In Zoho Projects, the Project Overview section is currently visible to client profiles by default. While user profiles already have the option to restrict or hide access to the project overview, the same flexibility isn’t available for client profiles.
    • Zoho Books | Product updates | August 2025

      Hello users, We’ve rolled out new features and enhancements in Zoho Books. From the right sidebar where you can manage all your widgets, to integrating Zoho Payments feeds in Zoho Books, explore the updates designed to enhance your bookkeeping experience.
    • 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
    • Feature Request: Assign Documents to Already Entered Bills, Expenses, Invoices, etc.

      Hi Zoho Team, We are regular users of the Documents module in Zoho Books and appreciate its ability to keep financial records well-organized. However, we’ve noticed a limitation: There is no way to attach a document from the "Documents > Files" section
    • I don't see any WITHDRAWL transaction at all

      Hi I manually imported my bank statement to Zoho books today and I am a complete newbie. I have been reading the knowledgebase but unable to fix this. I only see "Uncategorized 91 DEPOSIT transactions". I don't see any WITHDRAWL transaction at all. Also,
    • Shared inbox unable to see replies

      Hi we are a small company me and someone else, we have a shared inbox for our sale@ and contact@ however we have this issue where by if i reply to an email or the other person reply to the email, it does not show it to them and therefore we end up replying
    • Kaizen #136 - Zoho CRM Widgets using ReactJS

      Hey there! Welcome back to yet another insightful post in our Kaizen series! In this post, let's explore how to use ReactJS for Zoho CRM widgets. We will utilize the sample widget from one of our previous posts - Geocoding Leads' Addresses in ZOHO CRM
    • 404 error at checkout

      Our customers are getting a 404 error at checkout. Anyone else with the same problem?
    • FONT Sizing in Notebook

      Hi Kishore - What is the status of adding font sizing to the application? I have several things that I have pasted directly into Notebook and the fonts are HUGE! I would like the ability to highlight them and reduce the font to a legible size. Nothing
    • Can managers Upload documents to their direct rapports?

      Admin employees have the ability to upload documents to employees' files; however, managers do not have add/manage button - is it possible for managers to upload their direct reports' documents, such as absence documents or 121 documents. Is there something
    • Leave balance display for next year

      Is there a way to not have a rollover or not limit the leave balance depending on the date. For example an employee has 10 days leave balance and wants to apply for January leave in December. They cant because the rollover doesnt show the leave balance
    • Please add an “Auto-Apply Unused Credits” toggle

      Hello — please add a simple org-level option to automatically apply unused credits (credit notes, excess payments, retainers) to new invoices and/or bills. An ON/OFF toggle with choices “invoices”, “bills”, or “both” would save lots of manual work for
    • Zoho Books not working/loading

      Hi! I haven't been able to access/load Zoho Books for the past hours. I get a time out (and it is not due to my internet connection). Could you please check this asap? Thank you!
    • Custom Fields with Data Types for Expense and Payments Received in Zoho Books

      Hi all, We are glad to present to you, the option to create Custom Fields for the Expense and Payments received modules in Zoho Books. This also comes with an icing on top of it - Yes, the custom fields can now be created with different data types. Types like Text, Number, Decimal, Amount, Auto Number and Check Box are supported as of now. Rush to the gear icon at the top right corner, select 'More Settings', choose 'Preferences' in the left pane. Click the Expense/Payment preferences where you can
    • [Webinar] Automate sales and presales workflows with Writer

      Sales involves sharing a wide range of documents with customers across the presales, sales, and post-sales stages: NDAs, quotes, invoices, sales orders, and delivery paperwork. Generating and managing these documents manually slows down the overall sales
    • Zoho Cliq - Incident alert (Server outage - IN DC) | August 28

      We've received server down alerts and are currently investigating the issue (IN DC) to find the root cause. Our team is actively working to restore normal operations at the earliest. Status: Under investigation Start time: 09:44:21 AM IST Affected location:
    • Claude + MCP Server + Zoho CRM Integration – AI-Powered Sales Automation

      Hello Zoho Community 👋 I’m excited to share a recent integration we’ve worked on at OfficehubTech: ✅ Claude + MCP Server + Zoho CRM This integration connects Zoho CRM with Claude AI through our custom MCP Server, enabling intelligent AI-driven responses
    • 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.
    • Next Page