Function #45: Display discount in words.

Function #45: Display discount in words.



Welcome back everyone!

Last week's function was about creating invoices from custom modules and not just the Deals module . This week, it's going to be about displaying the discount in words.

Business scenario :

Offering discounts is one of the common approaches taken by most companies to clock more sales. It's a proven strategy to win more new customers and retain the existing ones. From a business operations perspective, discounts help you get rid of your old inventory. This is immensely beneficial in the long run.

It is very important to document the discounts provided within the CRM records Say, the same customer purchases from you after a long hiatus. Your negotiating agent must be aware of the previous deals made with the customer, including the amount of discount given earlier.

Usually, discounts are specified in percentage. Like 5% discount. There is a percentage field in Zoho CRM, which you can name as "Discount" and enter the value as 5 (Only for custom modules. Native Deals module already has a discount field). Some of our customers prefer the discount to be tracked on a text field in words. For example, "Discount of 5%" instead of just 5% in the percentage/discount field. This week's custom function helps you do just that.

Getting started with the function :

  1. Go to Setup > Automation > Actions > Functions > Configure Function > Write your own.
  2. Provide a name for the function. For example: "Discount in words". Add a description (optional).
  3. Copy the code given below.
  4. Click "Edit arguments".
  5. Enter the name as "customId" and select the value as "Custom Module Id".
  6. Click Save&Execute Script to check the code.
  7. Save the function.

The Code :

-----------------------------------------------------------------------------------------------------------------------

customDetails = zoho.crm.getRecordById("moduleapiname", customId.toLong());
//info customDetails;
percent = ifnull(customDetails.get("Discount"),"");
if( percent == "")
{
mp=map();
mp.put("Wording","");
update = zoho.crm.update("moduleapiname", input.customId.toLong(), mp);
info mp;
info update;
}
else
{
mp=map();
mp.put("Wording","Discount : "+input.percent + "%");
update = zoho.crm.update("moduleapiname", input.customId.toLong(), mp);
info mp;
info update;
}

-----------------------------------------------------------------------------------------------------------------------

Change ' moduleapiname ' with that module's api name. Also the field " Wording " is a custom field. You can name it any way you want.

Note:

  • The code given above works only for V2 version of Zoho APIs. Please note that the code WILL NOT work for Version 1.0 APIs.

Found this useful? Try it out and let me know how it works! If you have questions, do not hesitate to ask! Do check out other functions shared in this series here .

See you all next week with another interesting function. Ciao!

    Access your files securely from anywhere









                          Zoho Developer Community




                                                • Desk Community Learning Series


                                                • Digest


                                                • Functions


                                                • Meetups


                                                • Kbase


                                                • Resources


                                                • Glossary


                                                • Desk Marketplace


                                                • MVP Corner


                                                • Word of the Day


                                                • Ask the Experts



                                                          • Sticky Posts

                                                          • How to reach the official Zoho Support channels and avoid fake ones.

                                                            Dear Customers, Thanks a lot for choosing Zoho! Our applications are built to help achieve your day-to-day business goals. We are committed to engaging with you, to understand and develop solutions that enhance your productivity.  We are happy and ready to help you use our services effectively. Understanding and avoiding fake support Just like using popular bank names and financial applications for phishing purposes, using Zoho and claiming to be providing Zoho Support or services with false numbers
                                                          • Function #35: Close all tasks associated with a lead and create a new task.

                                                            Welcome back everyone! Last week, we learnt how to close all tasks of a deal depending upon the deal stage. This week, let's look at a custom function that lets you close all of the tasks associated with a lead while simultaneously creating a new task, like when you need to halt all progress towards a lead while the lead is not available at the moment but create a reminder task. Business scenario: The success of a company, in one way or another, is determined by the leads it gets. Each lead is just
                                                          • Zoho CRM Webinar - Redesigning Daily User Experiences with Canvas

                                                            <br> Your users across roles use the CRM for day-to-day tasks that are necessary. Whether they perform their tasks on time, the right way, or at all depends on a lot of factors, including User Experience. Many businesses struggle with rigid layouts,
                                                          • Join us at the Canada ZUG Meetup: What’s New in Zoho CRM

                                                            Hello Zoho Community! Start your year with fresh insights into Zoho CRM’s latest updates and tools. Whether you're a CRM beginner or a experienced user, this meetup is crafted to help you optimise your processes and leverage new features. Explore practical
                                                          • CRM Hack #2: Automate sending of birthday greetings to your customers.

                                                              Hello everyone! What sets you apart as a sales person is your ability to add that personal touch to your business relationship with your customers. Sending a gift on a special day, or leaving a note wishing them on their birthdays, are small, yet significant actions that show your customers that you care. And these are actions done without any expectations :) You must be engaging with a lot of customers and it is highly unlikely that they all are your friends on Facebook or some social channel,


                                                          Manage your brands on social media



                                                                Zoho TeamInbox Resources



                                                                    Zoho CRM Plus Resources

                                                                      Zoho Books Resources


                                                                        Zoho Subscriptions Resources

                                                                          Zoho Projects Resources


                                                                            Zoho Sprints Resources


                                                                              Qntrl Resources


                                                                                Zoho Creator Resources



                                                                                    Zoho CRM Resources

                                                                                    • CRM Community Learning Series

                                                                                      CRM Community Learning Series


                                                                                    • Kaizen

                                                                                      Kaizen

                                                                                    • Functions

                                                                                      Functions

                                                                                    • Meetups

                                                                                      Meetups

                                                                                    • Kbase

                                                                                      Kbase

                                                                                    • Resources

                                                                                      Resources

                                                                                    • Digest

                                                                                      Digest

                                                                                    • CRM Marketplace

                                                                                      CRM Marketplace

                                                                                    • MVP Corner

                                                                                      MVP Corner







                                                                                        Design. Discuss. Deliver.

                                                                                        Create visually engaging stories with Zoho Show.

                                                                                        Get Started Now


                                                                                          Zoho Show Resources


                                                                                            Zoho Writer Writer

                                                                                            Get Started. Write Away!

                                                                                            Writer is a powerful online word processor, designed for collaborative work.

                                                                                              Zoho CRM コンテンツ



                                                                                                Nederlandse Hulpbronnen


                                                                                                    ご検討中の方




                                                                                                          • Recent Topics

                                                                                                          • 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
                                                                                                          • User Session variables to recall after form submit & redirect to menu

                                                                                                            Hey, Forgive me if this is a simple answer I have overlooked. I have built a big onboarding process for my SAAS platform which is built and managed by an external Dev team. I am hoping to embed my new creator app on the SAAS platform. I have a menu page
                                                                                                          • Zoho Writer Merge Template with data from Zoho Analytics Views

                                                                                                            Hello, Is there any way to pull information from Zoho Analytics and put it into a Merge Template? I am trying to create a bulk export of one report that filters on a field to create a single document for each of the filter fields.
                                                                                                          • Having to enter bill before stock shows as available.

                                                                                                            Hi, Am I right in thinking you must create a bill from the purchase order receipt before the goods are available for shipping?
                                                                                                          • Agent Availability Report

                                                                                                            From data to decisions: A deep dive into ticketing system reports Businesses need to track when their support agents check in and check out from work. This report, titled Agent Availability, is one of the static reports that helps managers track the number
                                                                                                          • Writing by Hand in "Write" Notes

                                                                                                            Hi there! I just downloaded this app a few moments ago, and I was wondering if there was a way to write things by hand in "Write" mode instead of just typing in the keyboard. It would make things a bit more efficient for me in this moment. Thanks!
                                                                                                          • AI-driven construction analytics using Zoho Projects Plus

                                                                                                            Construction projects thrive on timelines; if a project is completed on or before the expected time, it makes headlines, but if it gets delayed, the company’s credibility will be at risk. Such projects require precise planning and constant monitoring,
                                                                                                          • Canadian payroll

                                                                                                            Hello ZOHO, is any updates on when payroll for Canada will be available?
                                                                                                          • Unified customer view: Bringing product intelligence into your CRM data

                                                                                                            For businesses today, applications and digital interfaces are the main touch points in the customer journey. While Zoho CRM data already tells who your customers are and what they buy, Zoho Apptics tells you how they interact and engage with your product.
                                                                                                          • Zoho Creator SaaS app with multiple client AND multiple users

                                                                                                            I am close to finalizing a Zoho Creator app that will be used by different companies to manage sale info, and each company can have multiple users using the app. Things were going perfectly until I tried a search on a report. I use a database field in each table to separate the data for each company, which works great. BUT when I do a search, I get to see ALL the data. This means that Company A could easily see the data from Companies B and C via the built-in search. Is there a way to set up the
                                                                                                          • Project Change Orders and Additions

                                                                                                            We are in the process of migrating from QuickBooks Online to Zoho Books. We have Zoho One and like the ability to sync all of our data across everything. And I like that projects work in a way that's less dumb than QuickBooks. I'm trying to figure out
                                                                                                          • Track online, in-office, and client location meetings separately with the new meeting venue option

                                                                                                            Hello everyone! We’re excited to announce meeting enhancements in Zoho CRM that bring more clarity and structure to how meetings are categorized. You can now specify the meeting venue to clearly indicate whether a meeting is being held online, at the
                                                                                                          • Possible to send Zoom AI Companion transcripts and summaries to contacts in CRM?

                                                                                                            Title says it all. Is it possible to send Zoom AI Companion transcripts and summaries to contacts in Zoho CRM?
                                                                                                          • How do I edit the Calendar Invite notifications for Interviews in Recruit?

                                                                                                            I'm setting up the Zoho Recruit Interview Calendar system but there's some notifications I don't have any control over. I've turned off all Workflows and Automations related to the Calendar Scheduling and it seems that it's the notification that is sent
                                                                                                          • Posibility to add Emoticons on the Email Subject of Templates

                                                                                                            Hi I´ve tried to add Emoticons on the Subject line of Email templates, the emoticon image does show up before saving the template or if I add the Emoticon while sending an Individual email and placing it manually on the subject line. Emoticons also show
                                                                                                          • Clarity on extended contract status

                                                                                                            Clarity on “extended” status- How does Zoho “extend” a contract?  E.g. if client extends by 1 month, can the “end date” be adjusted accordingly in Zoho and tagged as “Extended” with a clear audit trail that also captures the client’s email? Note- Email
                                                                                                          • Customizing contract status

                                                                                                            Can we customize/add/remove status on Zoho contracts ourselves or does Zoho needs to do this? Context- There is a long list of status on Zoho but not all of them are relevant for us . There are few status which are missing and needs to be added. E.g-
                                                                                                          • Set Custom Business Calendars and Holidays for Global Teams

                                                                                                            Managing a project across diverse teams means accounting for more than just tasks and deadlines; it means acknowledging how and when each team actually works. Users might follow different working days or observe region-specific holidays that cannot be
                                                                                                          • [Integration edition] Deluge learning series - Integrations between Zoho apps and Third-party services with Deluge | 28 August 2025

                                                                                                            We’re excited to welcome you to the Deluge learning series: Integration edition! The Integration edition will run for three months: Session 1 – Integrating Zoho Apps with Deluge using inbuilt integration tasks Session 2 – Integrating Zoho Apps with Deluge
                                                                                                          • Critical Vulnerability in all major password manager plugins - is Zoho Vault affected?

                                                                                                            Hi Zoho, a security researcher found a critical clickjacking vulnerability in all major browser password managers: DOM-based Extension Clickjacking: Your Password Manager Data at Risk | Marek Tóth Is Zoho Vault affected as well? Apparently the Vault extension
                                                                                                          • Introducing SecureForms in Zoho Vault

                                                                                                            Hey everyone, Let’s face it—asking someone to send over a password or other sensitive data is rarely straightforward. You wait. You nudge. You follow up once, twice—maybe more. And when the information finally arrives, it shows up in the worst possible
                                                                                                          • Change eMail Template for Event-Invitations

                                                                                                            Hello ZOHO-CRM Team How I can change the eMail Template for Event-Invitations? I work with the German Version of the Free Version. I know how I can modify eMail alerts or Signature Templates, but where I can other eMails modify you send out? Thank you for your answer. Regards, Juerg
                                                                                                          • Need Your Insights

                                                                                                            Hi Zoho, I'm confused why the flow only sends to one output. setVariable15 is from a list. It doesn't consider the 2nd entry. Any thoughts?
                                                                                                          • Map Dependency Fields - How can can I limit picklist values from a multi-select Parent field?

                                                                                                            I know the "Map Dependency Fields" feature doesn't allow a multi-select parent field. However, I need the functionality. Can I do it through a deluge function, and would it still support color coding picklists? We need the color coding for quick scanning
                                                                                                          • DYK 1 - Color Palette for Enhanced Visual Identification of Status

                                                                                                            Introducing the Did You Know series of posts. The goal of this series is to familiarize users with certain features or enhancements in Zoho Projects that may not be evident at first glance. The first post in this series deals with color palettes for indicating
                                                                                                          • Invalid field in the COQL query

                                                                                                            Dear Zoho Support! I believe that you already helped me with a similar problem a few years ago. One of my clients has a custom field named "LOB" in the "Deals" Module (see the field's metadata below). The COQL query using this field: : "select id, Deal_Name,
                                                                                                          • Automating Employee Birthday Notifications in Zoho Cliq

                                                                                                            Have you ever missed a birthday and felt like the office Grinch? Fear not, the Cliq Developer Platform has got your back! With Zoho Cliq's Schedulers, you can be the office party-cipant who never forgets a single cake, balloon, or awkward rendition of
                                                                                                          • Transferring domain registration to new registrar and switching email hosting at the same time?

                                                                                                            I need to transfer an existing domain uv cure adhesive that's currently with SiteGround to Porkbun. I also need to move the existing custom email addresses from SiteGround to Zoho Mail. I'm not sure if I should transfer the domain first and then tackle
                                                                                                          • Split deposits

                                                                                                            Can Zoho do split deposits. One deposit, two checks for two separate invoices from different customers. This is one of the most common tasks I can imaging. When I mark the two invoices paid, there are two deposits in bank register. When I try to match,
                                                                                                          • Next Page