Hello everyone!
 Have you ever wanted 
to trigger actions on click of a canvas button, icon, or text mandatory forms in Create/Edit and Clone Pages?  Have you ever wanted to 
control how elements behave on the new 
Canvas Record Forms? This can be achieved using Client Scripts support for Canvas Record Forms.
Welcome back to another interesting Kaizen post!  In this post, we can discuss Client Script Support for the new Canvas Record Form. 
In this kaizen post,
1. What is a Canvas Record Form? 
2. Client Script Events for the Canvas record forms
3. Supported ZDKs
4. Use Case 
5. Solution
6. Summary
7. Related Links
1. What is a Canvas Record Form?
Canvas Support for Create, Edit, and Clone Pages is referred to as Canvas Record Forms. With the advent of Canvas Record Forms, you can customize fields and sections of your form and ensure that every interaction with your CRM is efficient. It shifts the paradigm from simple data management to creating a 
more engaging, intuitive CRM experience. Click here for more details about Canvas Record Forms. Client Script support for these Canvas Record Forms 
unlocks new customizations like scrolling to a particular section automatically when a product category is selected, display a custom message when an icon or image is clicked, show a flyout or a pop up when a button is clicked in Create/Edit and Clone Pages.
 
2. Client Script Events available for the record forms
- Mandatory Fields Form 
- Canvas button
- Icon 
- Text
- Page
- Field
Click here for more details on Client Script Events.
 3. Supported ZDKs
In addition to the ZDKs available for the Create/Edit/Clone (Standard) Pages, the following list of additional methods can also be used in Create/Clone and Edit(Canvas) Pages .
- scrollTo() - Make the page scroll to a particular element.
- highlight() - Highlight an element.
- setVisibility() - Hide or show an element.
- addToolTip() - Add tool tip to an element.
- removeToolTip() - Remove tool tip for an element.
- addStyle() - Add styles to an element.
- freeze() - Freeze a particular element.
- setReadOnly() - Make an element read-only
- setContent() - Add content to the text element.
- setImage() - Add an image.
- setActive() - Make an element active.
 
4. Use Case
Consider Zylker, a manufacturing organization. Their service agents use the Orders module of their CRM to create and manage orders for their customers. They have used the latest Canvas Record Form view for their Create Page as shown below.
Below are their requirements.
A. When the checkbox "Is shipping address same as billing address?" is checked, the Shipping Address section should not be visible.
B. When the user clicks the "Add Dental Products" button, a pop-up should appear showing the Dental Instruments available in the Products module, and the instrument details selected in this pop-up should get inserted as rows in the sub-form.
5. Solution
To accomplish the above requirements on the Create Page(Canvas),  you need to create the following two Client Scripts.
A. Client Script with field event on field "Is shipping address same as billing address?"
- Go to Setup > Developer Space > Client Script. Click +New Script.
- Specify the details to create a script and click Next.
 
- Enter the following script and click Save.
 
- let elem = ZDK.UI.getElementByID('shipping_address');
- if (value==true)
- {
- elem.setVisibility(false);
- }
 
- else 
- {
- elem.setVisibility(true);
- }
- In the above script, "value" will hold the boolean value which hold the user selection of the check box "is-shipping_same_billing". If it is true, then using setVisibility() you can hide the shipping address section. To fetch the ID of the Shipping Address section, you can use ZDK.UI.getElementByID().
- Here is how the Client Script works.
 
- When the user marks "Is shipping address same as billing address" true, you can see that the "Shipping Address" section disappears. 
 
B. Client Script with button event on canvas button "Add Dental Products"
- Go to Setup > Developer Space > Client Script. Click +New Script.
- Specify the details to create a script and click Next.
 
Enter the following script and click Save.
- let products_list = ZDK.Page.getField('Product_List').getValue();
- log(products_list);
- if (products_list.length === 1) { // Clear subform if empty row
-     !Object.values(products_list[0]).every(value => !!value) && products_list.pop();
- }
- // Open widget with product category & max. allowed rows based on existing subform data
- let selected_products = ZDK.Client.openPopup({
-     api_name: 'Choose_Products', type: 'widget', header: 'Choose Products', animation_type: 1, height: '570px', width: '1359px', left: '280px'
- }, {
-     product_category: "Dental Instruments", max_rows: 25 - products_list.length
- });
 
- log("products selected from widget: ", selected_products);
 
- // Update Selected Products from the widget Popup 
- if (selected_products.length) {
-     
-     selected_products.forEach(product => {
-         products_list.push({ Product_Name1: { id: product.id, name: product.Product_Name }, Quantity_of_Products: 1, Unit_Price1: product.Unit_Price });
-     });
-     console.log(products_list);
-    ZDK.Page.getField('Product_List').setValue(products_list);
- }
- Whenever the button "Add Dental Products" is clicked, you can open a widget as a pop up using ZDK.Client.openPopup(). The details of user selection in the widget will be fetched in the "selected products" variable. You can iterate and create a list to be populated to the Dental Instruments Section. Then this list of values can be populated with the help of setValue().
- Here is how the Client Script works.
 
- When the user clicks the "Add Dental Products" button, a widget of button type that shows the list of Instruments appears. This gets displayed by the Canvas Button event of Create Page (Canvas) and the selected records get inserted in the Dental Instruments subform.
 
- Here, using Client Script, you can instantly add all selected products with a single click, eliminating the need to repeatedly click the "+ Add row" button for each product.
 
6. Summary
In this post, we have discussed,
- How to hide a section dynamically using Client Script.
- How to open a Widget , fetch the content and populate it to a Canvas page.
7. Related Links
- Recent Topics
- Line spacing- I coudn't decrease the line spacing to space smaller then a single line. There is too much space between the lines that make the document look ugly. Please fix that. Liran. fonar 
- Google Fonts Integration in Pagesense Popup Editor- Hello Zoho Pagesense Team, We hope you're doing well. We’d like to submit a feature request to enhance Zoho Pagesense’s popup editor with Google Fonts support. Current Limitation: Currently, Pagesense offers a limited set of default fonts. Google Fonts 
- Control Position of “X” (Close) Button in Popup Editor- Hello Zoho PageSense Team, We hope you're doing well. We would like to request a customization improvement in the PageSense popup editor. Current Limitation: Currently, the position of the “X” (close) button is fixed and cannot be customized in the popup 
- Add Standalone “Save” Button in Pagesense Popup Editor- Hello Zoho Pagesense Team, We hope you're doing well. We would like to request an important usability improvement in the Pagesense popup editor. Current Limitation: There is currently no dedicated Save button while building a popup. The only way to save 
- Text Direction Control in Pagesense Popup Editor- Hello Zoho Pagesense Team, We hope you're doing well. We’d like to submit a feature request to add text direction control in the Pagesense popup editor. Current Limitation: Currently, the popup editor does not provide native support for RTL (Right-to-Left) 
- Autosave in Pagesense Popup Editor- Hello Zoho Pagesense Team, We hope you're doing well. We’d like to submit a feature request to enhance the Pagesense editor with an autosave functionality. Current Limitation: Currently, changes made in the Pagesense editor must be manually saved. In 
- Billing frequency is not displayed correctly.- Hello There is an issue while displaying the billing frequency on a subscription quote. I am able to activate the subscription details and get this lovely overview: If I am adding a Plan which I charge quarterly, first of all it should be possible to 
- Creating Secret via Vault API- Hi I am trying to create a secret through vault api.  This is the response I get. One thing I am not sure is how to decrypt the secretdata, how to get the secrettypeid? {     "operation": {         "result": {             "error_code": "",             "message": "Sorry, we are unable to process your request.", 
- Zoho  CRM custom fields not showing in zoho creator - Hi Team, I have created a Products form with Zoho CRM integration and connected it to Products module of CRM. But when I see the reports of Products in Zoho creator then I am not able to see custom fields of Products module. Only standard fields of Products 
- Is It Possible to Hide Menu Option from Main Navigation?- Is it possible to hide a menu option, e.g. Admin, from the Main Navigation based on some criteria, e.g. login = zoho.adminuser 
- Unleash the power of detail, with Table View.- What use is context that's not available where you need it? With this in mind, we bring you the Table View. This feature will add more power to the way you organize and work through your ticket load. Table View comes in handy when you want more control over the ticket information you see. This is a nifty tool for users who find themselves limited in terms of the level of information that is being offered in the Classic View and Compact View. With an upper limit of 15 columns, agents can glean most 
- Kaizen #126 - Circuits in Zoho CRM - Part 1- Hello everyone! Welcome back to another week of Kaizen! Today, we will discuss an exciting topic—Circuits in Zoho CRM. For starters, we will discuss what Circuits are, how beneficial they are for businesses, different views of a Circuit, and the different 
- 'Statement of Accounts does not exist' error received, when creating PO using api in Zoho Inventory- Here is request json -- JSONString = { "date": "2019-09-24", "purchaseorder_number": "PO-6-1", "delivery_date": null, "delivery_org_address_id": 36221200000056XXX, "vendor_id": 362212000000564XXX, "attention": "Testing", "line_items": [{ "unit": "Pieces", "account_id": 36221200000003XXX, "quantity": 1, "item_id": 362212000000049XXX, "tax_type": "", "tax_name": "", "name": "One HD", "purchase_rate": 85, "tax_percentage": 0, "item_total": 85.00, "tax_id": "", "warehouse_id": 362212000000564XXX }] } 
- Multiple clients in one project- Hi team, What is the possibility to have more than one client to be linked for one project in the Zoho Books? Our business model is to have a project, and this project have expenses/bills, as well, we issue invoices for this same project to several customers. 
- Support Bots and Automations in External Channels- Hello Zoho Cliq Team, How are you? We actively use Zoho Cliq for collaboration, including with our external developers. For this purpose, external channels are a key tool since they work seamlessly within the same interface as all of our other channels 
- Workdrive on Android - Gallery Photo Backups- Hello, Is there any way of backing up the photos on my android phone directly to a specific folder on Workdrive? Assuming i have the workdrive app installed on the phone in question. Emma 
- Need more details on API Usage Dashboard- Hi Team, We have implemented Zoho Expense for a client and has done some integrations with well known third party ERP via api. Recently we have noticed a huge spike in the API consumption. But we couldn't get the root cause for the same. I accept there 
- Rendering PDF to view on page- My company upload lots of PDF files onto Zoho. But every time we open it, it downloads the file instead of viewing it on the web page. Does Zoho allow uploaded PDF files to be rendered to view on web page yet? I've been trying to use <embed> or <object> but it cannot be loaded.  (similar thread: https://help.zoho.com/portal/community/topic/how-to-open-a-pdf-file-of-a-view-in-preview-mode) 
- Dynamically Fetching Lookup Field Display Value- I have an audit trail form, Audit_Changes, that tracks old vs new values across different forms. For lookup fields, the old/new value is the ID, but I also need the display value. What's a best practice for dynamically fetching the display value of the 
- Subform Disabled Fields Should Remain Disabled on Edit/View- Currently, when we disable a subform field using on user input or on add new row, it works perfectly during the initial data entry. However, when the record is saved and reopened for viewing or editing, these disabled fields become editable again. This 
- Ability to Create New Items When Zoho Trident is Minimized via tray or taskbar icon- Allow users to create new items (emails, calendar events, tasks, etc.) directly from the system tray icon or by right clicking the task bar icon, even when the window is minimized or not actively running in the foreground. This enables quick access to 
- Bug Report and Suggestions for Improvement in Zoho Applications- Hi Zoho Team, I’d like to report a few bugs and improvement suggestions I’ve noticed while using Zoho products: Zoho Cliq Video Call: The camera sometimes turns off automatically during video calls. This seems to be a bug — please check and fix it. Zoho 
- I can not see Undeliverable emails from my Mass Email Leads activity in CRM- I am sending email templates and I can not see the Undeliverables? I only receive the "Out of Office" replies and any manual replies from the lead. Can you please let me know where the Undeliverable emails are sent so I can use the information to clean up the database? 
- Select Zoho Contacts as Meeting Participants in Zoho Cliq- Hello Zoho Cliq Team, We hope you're doing well. We would like to request an enhancement to the meeting scheduling functionality in Zoho Cliq. Current Limitation: When scheduling a meeting in Zoho Cliq, participants can only be selected from: Organization 
- Ability to Select External Users from Participants List When Scheduling Meetings- Hello Zoho Cliq Team, We hope you're doing well. We would like to request an enhancement to the meeting scheduling experience in Zoho Cliq. Current Limitation when scheduling a meeting in Zoho Cliq: External users can be selected from the list only under 
- Kaizen #212 - Map Dependency Fields in Zoho CRM using APIs- Hi Everyone!! Welcome back to another week of Kaizen series! Over the past few weeks, we have been addressing your questions and feedback shared through our Kaizen 200th feedback form. Thank you for your continued engagement and thoughtful queries. We 
- Outdated state in mexico- Hello Zoho team, the drop down to add the state for customers, when they introduce their state in mexico has a city named “Distrito Federal” that name changed many years ago to “ciudad de mexico”. could you please update this so my clients can find the 
- Is anyone using Zoho Flow with airtable?- I need to build a flow that collects data from airtable and uses some of that data to create folders and files in google drive. I have fully function version of this in zapier and want to migrate to zoho. I am trying to perform a very basic fetch from 
- SOME FEATURES ARE NOT IN THE ZOHO SHEET IN COMPARISION TO ZOHO SHEET - TO ZOHO sir/maam with due to respect i want to say that i am using ZOHO tool which is spreadsheet i want to say that some features are not there in zoho sheet as comparison to MS EXCEL like advance filter and other Features which should be there in ZOHO 
- AI in Zoho Workplace: A Sneak Peek into What’s Coming!- Hello everyone, We’re super excited to share something we’ve been working on and we want you to be part of it! You may have seen our announcement blog post introducing a major evolution in how AI works within Zoho Workplace. Want to be among the first 
- Display Client Name in Zoho Creator Client Portal Dashboard- Hello Zoho Creator Team, We hope you are doing well. Zoho Creator recently introduced the option to set a client’s display name in the Client Portal settings, which is very helpful for providing a personalized portal experience. However, there is currently 
- Meet Canvas' Grid component: Your easiest way to build responsive record templates- Visual design can be exciting—until you're knee-deep in the details. Whether it's aligning text boxes to prevent overlaps, fixing negative space, or simply making sure the right data stands out, just ironing out inconsistencies takes a lot of moving parts. 
- Best way to share/download presentation files in Zoho without losing formatting?- Hello Zoho Community, I often work with PPT/PDF files in Zoho Docs and share them with colleagues. While PDFs usually give a direct download option, I’ve noticed that PPT/PPTX files sometimes only open in the viewer without a clear download link. Is there 
- Workflow Failure - Notifications- Good afternoon, I have just experienced an error whereby a Workflow failed, for a reason currently unknown. The problem is that one of my users had to flag this manually (thankfully he's very thorough) and this otherwise would have flown under the radar. 
- Introducing Bin Locations In Zoho Inventory- Hello users, We are excited to let you know that your wait for the Bin Locations feature has now come to an end! Yes, you heard us right! We are here to introduce the much-awaited Bin Locations now in Zoho Inventory. But before we dive into the feature 
- Error "Invalid client task found corresponding properties" only when triggered from workflow ?- Hi All, I am facing an error message I never encountered previously: Error in executing On Add - On Load script Error in executing thisapp.get_all_projects_api_call function. Line:(2) Error in executing thisapp.getAccessTokenFromRefreshToken function. 
- How to interpret Campaign report statistics - definitions/explanation- I am trying to make sure I understand the Campaign report correctly Do you have a list of definitions for: Delivered - it has reached the recipient's inbox Campaign reach - is this the number that have opened the campaign email? Unique Opens Clicks/Open 
- Subforms in Stateless Forms- Stateless Forms are very useful, but we can't build complex data entry pages without Subforms. Can this be implemented? This would make Stateless Forms truly powerful. 
- Feature request - pin or flag note- Hi, It would be great if you could either pin or flag one or more notes so that they remain visible when there are a bunch of notes and some get hidden in the list. Sometimes you are looking for a particular name that gets lost in a bunch of less important 
- Schedule a Call by Date and Time when a specific lead status is selected- Hi Wanting to create a workflow where a call can be scheduled by date & time when a specific lead status is selected. Can only currently set the date by Due Date - Trigger Date - Plus 'x' day(s) Thanks 
- Next Page