User Tips: Adding Multiple Products (Package) to a Quote v2.0 (with Client Script)

User Tips: Adding Multiple Products (Package) to a Quote v2.0 (with Client Script)

This solution is an improvement on the original idea which used deluge. My solution was posted in the comments are: https://help.zoho.com/portal/en/community/topic/adding-multiple-products-package-to-a-quote

The updated version uses client script instead of deluge.

Hopefully this might help a few people. It helps our reps speed up the process of creating quotes and quoting accurately.

Details below:


Problem:

We run numerous manufacturer promotions with various bundled items and discounts. Reps struggle to remember all details, leading to incorrect discounts on quotes.


Solution

I created a custom module for Product Packages. For each promotion, we create a "Package" including all products, discounts, and start/end dates. A quote lookup field allows users to select a package, automatically adding the related products with accurate pricing and information.

When a user selects a package, a client script retrieves all related products and discounts, adding them to the quote. The lookup field is then reset for additional product entries.

Some fields on the package layout include:

  1. Promotion type
  2. Status
  3. Start / End dates for the promotion. 
  4. Pop-up message field if we want to show the rep a message when quoting the package

I also have a workflow that sets the package to “Expired” when the record expiration date hits. The lookup is filtered in the quotes module to only show “Active” packages.

In Action (with lookup field to the package module):



The Setup:
Create a custom module “Package Items”. Add the fields as below. 



Additional Info
1. I also use client script to hide the “Auto-Quote” field when in a standard view page
2. When I name a package, a deluge script runs to append the Package ID number which is an auto-number field.


The Code: 

  1. try {
    // List of funny loading messages
    var loadingMessages = [
    "Cranking up the quote machine...",
    "One sec... just stepped out for coffee.",
    "Hold tight! The hamsters are running the wheels.",
    "Almost there... giving it a little extra attention.",
    "Loading... probably faster than your internet speed.",
    "Please hold while we make magic happen.",
    "Just a moment... our servers are stretching their legs.",
    "Your patience is appreciated... and rewarded!",
    "Brewing up your quote right now...",
    "Give us a second... we're flexing our technical muscles.",
    "Our system is doing some yoga... stay calm!",
    "Loading... don't worry, it's not stuck!",
    "Fetching your data... hopefully with no detours!",
    "Keep calm and let us handle the rest.",
    "Processing... taking a coffee break, be right back!",
    "Stay tuned... greatness is loading.",
    "Our system is running... faster than a cheetah!",
    "Looks like you're going all in on this quote!",
    "Getting things ready... just need a moment.",
    "Hold on... we're aligning some stars for you.",
    "Please wait... we're feeding the server squirrels.",
    "One moment... your quote is coming fresh out of the oven.",
    "Loading... just making sure everything is perfect!",
    "Generating your quote... thanks for your patience!",
    "Almost there... your quote is worth the wait!"
    ];

    // Select a random message from the list
    var randomMessage = loadingMessages[Math.floor(Math.random() * loadingMessages.length)];

    // Log the entire value object to see its structure
    log("Full value object: " + JSON.stringify(value));

    // Ensure value.id is defined before proceeding
    if (!value || !value.id) {
    log("No product selected or value.id is undefined");
    return; // Exit the script quietly since no valid product was selected
    }

    // Show loader
    ZDK.Client.showLoader({ type: 'page', template: 'vertical-bar', message: randomMessage });

    // Extract the product ID and name from the value passed in
    var packageId = value.id;
    var packageName = value.name;
    log("Product ID: " + packageId);
    log("Package Name: " + packageName);

    // Get the subform field from Quotes module
    var quotedItemsSubform = ZDK.Page.getField("Quoted_Items");

    // Fetch product information for the package ID
    var packageDetails = ZDK.Apps.CRM.Auto_Quote_Packages.fetchById(packageId);


    var packageStatus = packageDetails.Status; // Active or Expired.
    var popUpMessage = packageDetails.Pop_Up_Message; // Check the package for any Pop-up message we want to show
    log("Package Details: " + JSON.stringify(packageDetails));
    log("Package Status: " + packageStatus);
    log("Pop-Up Message: " + popUpMessage);

    // Initialize array for existing line items.
    var existingLineItems = quotedItemsSubform.getValue() || [];
    log("Existing line items: " + JSON.stringify(existingLineItems));
    //
    // Only include rows with products. Excude any blank rows from the quote
    var filteredExistingLineItems = existingLineItems.filter(function(item) {
    return item.Product_Name && item.Product_Name.id;
    }).map(function(item) {
    return {
    id: item.Product_Name.id // Include only the item ID
    };
    });
    log("Filtered existing line items: " + JSON.stringify(filteredExistingLineItems));

    // Array to hold new line items we are adding
    var newLineItemArray = [];

    // Check if package is active and populate new line items
    if (packageStatus === "Active") {
    var packageItems = packageDetails.Package_Details;
    packageItems.forEach(function(item) {
    var productLineItem = {
    Product_Name: {
    id: item.Item_Code.id,
    name: `${item.Item_Code.name} (${item.Item_Name})`
    },
    Product_List_Price: item.Item_Price,
    Description: item.Item_Description,
    List_Price: item.Item_Price,
    Quantity: item.Item_Quantity ?? 1, // Default to 1 if Qty is null or undefined
    Discount: Math.abs(item.Item_Discount ?? 0) // Get the discount or default to 0 if null
    };
    log("New product line item: " + JSON.stringify(productLineItem));
    newLineItemArray.push(productLineItem);
    });
    } else {
    // Show error message if the package is not active
    // My layout to only show Active items but if you don't do that this solves it.
    ZDK.Client.showMessage('This package / promo is no longer active. Please contact the admin for details.', { type: 'error' });
    ZDK.Client.hideLoader();
    return; // Exit the script since the package is not active
    }

    // Combine existing line items with new line items
    var updatedLineItemArray = filteredExistingLineItems.concat(newLineItemArray);
    log("Updated line items array: " + JSON.stringify(updatedLineItemArray));

    // Add all updated items to the Quotes page
    quotedItemsSubform.setValue(updatedLineItemArray);

    // Reset the pick list field so user can re-use
    ZDK.Page.getField("Auto_Quote").setValue(null);

    // Hide loader
    ZDK.Client.hideLoader();

    log("Final updated line items: " + JSON.stringify(updatedLineItemArray));

    // Function to show confirmation and number of items added back to the user
    var showSuccessMessage = function() {
    ZDK.Client.showMessage(`${value.name} selected. ${newLineItemArray.length} items added successfully.`, { type: 'success' });
    };

    // Function to show popup message and then success message
    var showAlertAndSuccess = function(message, heading, buttonText) {
    ZDK.Client.showAlert(message, heading, buttonText);
    showSuccessMessage();
    };

    // Check for pop-up message and show alert if it exists
    if (popUpMessage) {
    showAlertAndSuccess(popUpMessage, "Important Information", "Got It!");
    } else {
    // No pop-up message, show the success message
    showSuccessMessage();
    }
    } catch (error) {
    // Log the error
    log('Error: ' + error.message);

    // Show error message
    ZDK.Client.showMessage('An error occurred while adding items. Please try again.', { type: 'error' });

    // Hide loader
    ZDK.Client.hideLoader();
    }

    • Recent Topics

    • How do I rename the dropdown that contains a form and a report?

      I want to rename this, but I can't find how
    • Filtering two fields

      Hoping somone can assist, i am trying to create a report to show values from two different fields. e.g I have Field 1 Field 2 In some records, fields 1 and 2 are both "yes"; in other records, only one of the fields has the value "yes". Can we generate
    • Unable to Convert Quote to Invoice – Integration Active but User Not Recognized

      I’m having trouble converting a Quote into an Invoice inside Zoho CRM, even though the Zoho Finance Suite integration is enabled (Invoices, Quotes, Products, and Customers are all checked), and my user is an Admin in both Zoho CRM and Zoho Books, using
    • Owner drawings

      I entered an owner’s drawing transaction in 2023 but it’s still appearing on 2024 books. Is that supposed to happen? Or should Is there an additional step? I prefer for this transaction not to appear.
    • Running Balance in Account Statement.

      Running balance should come by default in the accounting statements but in ZOHO we need to customize every time to get the running balance in accounting statement. I did not understand, when the bank account statement opened from Bank Menu can show the
    • Importing Invoices

      Dear Team I used the enclosed csv file to import some invoices and it worked fine. I had to delete the file and when I am trying to re-upload it, I am getting the error for invoice number and branch "Resource does not exit." I tried a number of different
    • Enhance "Send Cliq Notification" Action in Zoho Desk Workflows (and also add Happiness Rating Support)

      ello Zoho Desk Team, We hope you're doing well. We’d like to submit a feature request regarding the “Send Cliq Notification” action available in Zoho Desk workflows — specifically in workflows triggered by Happiness Ratings, but also relevant to all workflows
    • Treatment of Non-Refundable Income after cancelling an Invoice

      A customer made part payments of 30,000 for an invoice 0f 100,000, and then he is unable to pay up the remaining and has asked for a refund. As per company policy, he can only get 75% of the amount paid, which is 22,500. The remaining 7,500 is non-refundable
    • I need refund

      I have purchased the Zoho Book standard plan; I had the impression that I would get the purchase > Bill feature. After purchasing, I found that billing is not included in the Zoho standard plan. I immediately canceled the subscription. I love the product,
    • Handling identifiers during an import

      Importing your data When importing data into an application, it is crucial to prevent data loss or duplication. These types of errors can hinder the development of a clean and well-organised database, which is essential for effective data management and
    • Creating Deposit Invoices

      Hi, we are a company that does project based work with a request at the begining of each project for a deposit payment. At the moment we are creating invoices for the deposit and an invoice for the completion of the project, however they are completely
    • Marketer’s Space - WhatsApp Pricing Update: What Marketers Need to Know and Do

      Hello Marketers, Welcome back to Marketer’s Space! WhatsApp made changes to their pricing model on July 1, 2025, moving from conversation-based pricing to a per-message pricing model. This week’s post focuses on what these changes mean for your WhatsApp
    • It's time to say goodbye to Zoho Recruit for me.

      Hello, I have been a Zoho Recruit user since 2013. The tool has evolved, with a better UI, new features and so on. The pricing is still a great asset too. BUT, that being said, important features are not coming fast enough. I tried to share my point of
    • change subscription within customer portal

      Would be great for the customer to be able to change their own subscription (or restart existing one) within the customer portal. Also, would like to be able to have early termination fee on subscriptions if canceled early.
    • How to make the add-on optional at the time of subscription?

      The scenario is this, we have a service which has optional add-ons. Like the customer who purchased the subscription may or may not want to get the add-on. In our case if the customer choose the addon we have monetary benefit. In case the user does not
    • Unable to add attachments to knowledge base anymore

      I have been adding articles to knowledge base in Zoho Desk (as part of Zoho One). Today suddenly i found that I am unable to upload and attachments to the articles. I get the following error: "Attachment couldn't be added." I have uploaded the screenshot
    • Advanced factors for multiple scoring rules: Now with Zia scoring automations for all modules

      Greetings all, We're happy to offer improved scoring features by adding extra scoring factors, including Zia Scores, in our multiple scoring rules (MSR) feature. These new factors—which empower existing traditional scoring factors—include criteria for
    • Sortie de Zoho TABLE ??

      Bonjour, Depuis bientôt 2 ans l'application zoho table est sortie en dehors de l'UE ? Depuis un an elle est annoncée en Europe Mais en vrai, c'est pour quand exactement ??
    • Restrict Agents from Editing Shared Custom Views in Zoho Desk

      Hello Zoho Desk Team, We hope you're doing well. We’d like to submit a feature request regarding the custom views functionality in Zoho Desk. 🎯 Background We’re actively using custom views to filter and display tickets for different teams based on specific
    • Introduction Dario Schiraldi Deutsche Bank Executive

      Hello Everyone, Dario Schiraldi serves as a key leader at Deutsche Bank, where he plays a crucial role in shaping the bank's strategic direction and driving operational success. With a solid foundation in finance and leadership, Dario is committed to
    • Is Zoho Shifts included in the Zoho One plan?

      In case the answer is no: there's any plan to make it available via One? Thank you
    • Feature Request: API Access for Managing Deluge Functions (with OAuth & Change Tracking)

      Hi everyone, I wanted to share a thoughtful request that came in from one of our Zoho clients this week. I believe many of us as partners and developers might relate to it. “One quick item to flag: we’d love an official way to manage Deluge functions
    • Moving Subscriptions from one Customer to another

      We frequently need to move subscriptions from one Customer to another Customer in Zoho Billing and the only way we have figured out to do this is to cancel it in the old owner's profile and manually recreate in in the new owner's profile. In doing this,
    • how to add new line in Deluge?

      I want to make string with line separation like this: this is the first line second line third line I have tried to use \n <br> or </br> inside the string but I can't achieve the result like the example above. I want to create a task by using custom function
    • How to pause a subscription/recurring order ?

      Hello, I'm evaluating Zoho Subscriptions for a food co-op where members order a box of produce every week. The software that we're currently using allows members to set up a recurring order. Members can pause the recurring order when they don't want a box for a while and then resume it later. Is it possible to pause/resume a subscription ? Thanks John
    • Hosted Payment Pages - how to update the address in zoho billing

      I"m playing around with the muti-page hosted payment pages which have places for customers to enter their addresses when paying. Why does this not update their address in Zoho Billing after payment? What can I do to make this happen?
    • Tracking training certification expirations

      Hi Zoho Community! I'm looking for some input on the best and most efficient ways to track training expirations in Zoho CRM. I have a very specific workflow that I am looking for - my company offers trainings, and the certification expires every 2 to
    • Kaizen #164 : Client Credentials

      Hello everyone, Welcome back to Kaizen. In this post, we will discuss Client Credentials Flow and when it can be used. What is Client Credentials Flow? According to RFC6749, the official specification for the OAuth 2.0 authorization framework, "The client
    • CRM Email Template Align Left Instead of Center

      Is there a way to make a basic template align to the left instead of center? I know I'm likely forced to the 600px wide with the basic templates but I would REALLY like to set the email to the left instead of center. The basic templates make all the emails
    • Client Script - "Click' Button on Purchase Order - Specify "To Contact" or "To Supplier"

      The send email button is unique on the purchase order in that is has an additional submenu to send email "To Contact" or "To Supplier" It appears that the "click" event in Client script doesn't work correctly, probably because the button click didn't
    • Add Client Credentials Flow to Python SDK

      The Zoho CRM API supports a client credentials flow to automatically generate ephemeral access tokens, and this can be done programatically. The Python SDK however requires you to provide a grant token, refresh token, or access token when initializing
    • Conditional display of fields in Zoho Books Custom modules based on another field

      We're currently working with a Custom Module in Zoho Books and have a question about improving data entry efficiency and user experience. Our module includes a "Client Type" dropdown field, which determines the type of information to be collected. Each
    • Background Image for page in Zoho Creator

      Is it possible to use an image as the background in a page in Zoho Creator? I see it is possible to use an image as the background within a panel, but about about the page itself?
    • Zoho IP address blocked by Microsoft

      Today I tried to send emails to Outlook email addresses and all of them failed. The log displays like this: Reporting-MTA: dns; mx.zohomail.jp Arrival-Date: Fri, 27 Jun 2025 12:52:30 +0800 Original-Recipient: rfc822; ######@outlook.com Final-Recipient:
    • Request to Enable Full DNS Management Access for My Domain

      Hello Zoho Support Team, I have purchased the domain "digimarts365.online" through Zoho, and I need to add A and CNAME records to connect it with my Shopify store. However, DNS Toolkit is not allowing me to edit or add any records. Kindly enable full
    • Backup flow, see change log / history

      Hello, I would like to know, how flows can be saved, copied and tracked. If I work on a Flow with multiple other colleagues we need to see the Changes made by others. Is there a history, changelog or something else? Also we need to backup/import flows
    • Problème de validation du domaine spelam.ma

      Bonjour équipe Zoho, J’ai l’honneur de vous contacter car je rencontre un problème technique au niveau de la validation de mon compte ou de mon domaine spelam.ma. En effet, j’ai déjà acheté le domaine, mais la validation ne semble pas être correctement
    • Critical:- Eneble TDS filing for 26Q from the zoho book

      We currently extract TDS data from Zoho Books and manually input it into a separate TDS software to generate the FUV file and file returns. Previously, while using Tally, we benefited from an integrated feature that seamlessly recorded transactions and
    • Add a way of clearing fields values in Flow actions

      It would be great if there was an option to set a field as Null when creating flows. I had an instance today where I just wanted to clear a long integer field in the CRM based on an action in Projects but I had to write a custom function. It would be
    • Writer loads as a blank page.

      Hi, I'm new to zoho but I liked the idea of an online wordprocessor that I can use from multiple computers. I signed up a few hours ago while at work where our computers use Linus Ubuntu and a Firefox browser and the Writer came up fine. Now I'm home and using my Windows machine with Norton Firewall and Firefox and the writer opens as a blank page. I've checked my security options in both Firefox & Norton and I have received all the cookies from Zoho. What gives?
    • Next Page