Navigate between pages

Navigate between pages

 
Hello everyone!

Welcome back to another exciting Kaizen post. In this post, let us see how you can you navigate to different Pages using Client Script. 


In this Kaizen post,
  1. Need to Navigate to different Pages
  2. Client Script ZDKs related to navigation
         A. navigateTo()
         B. navigation_data
  3. Use Case
  4. Solution
  5. Summary
  6. Related Links


1. Need to Navigate to different Module's Pages in Zoho CRM

Often navigation between Module pages is required for improved user experience and streamlined workflows. Seamless transitions between related modules ensure quick access to relevant data and actions, enhancing productivity. For example, whenever the status of Account is updated to "Deal Creation", you can open the Deal Create Page. 

2. ZDKs to navigate to different pages

A. navigateTo()

Using this ZDK method, you can open any modules' detail/create/clone/edit page in a new tab or in same tab. Here is the syntax.



Click here to know more details.

B. navigation_data

Using The Constant , $Page.navigation_data, you can get the data passed from navigateTo() method.



Click here to know more details.

3. Use Case

Zylker is a manufacturing organisation uses Zoho CRM. The admin wants to automatically open the Deal Create Page whenever the status in the Detail Page of Account is "Deal Creation". Also Deal Create Page should have the "Account Name"  prefilled from the Detail Page of Account record."

4. Solution

If the user updates the status to "Deal Creation" in Accounts module you need get confirmation from the user and  open a new Deal Create Page automatically with Account Name prefilled. 

To accomplish this using Client Script, you need to create two Client Scripts. 

A. Client Script for Accounts Module
B. Client Script for Deals Module

A. Client Script for Accounts Module

Create a Client Script for Detail Page of "Accounts" module with the following details and click "Next". To know more about Creating Client Script, click here.


  • In the Client Script IDE, enter the below script and click Save.
  1. var a_name = ZDK.Page.getField("Account_Name").getValue();
  2. var rec_id = $Page.record_id;
  3. if (value == "Deal Creation")
  4. {
  5.     var resp=ZDK.Client.showConfirmation("Do you want to update the status as Deal Creation?");
  6.     if (resp)
  7.     {
  8.         var rec = $Page.record;
  9.         var rec_id = $Page.record_id;
  10.         rec.status = "Deal Creation";
  11.         var response = ZDK.Apps.CRM.Accounts.updateById(rec, rec_id);
  12.         log(response);
  13.  ZDK.Client.navigateTo('record_create', { module: 'Deals', custom_data: {data: a_name,data_id :$Page.record_id}}, '_blank')
  14.     }
  15. }

  • Whenever the status is updated to "Deal Creation" , you can show a Confirmation box using showConfirmation() asking whether the user wants to update the status as "Deal Creation"
  • Then, update the current record's status using updateById(). You can use the $Page, to get the current record id.
  • Then using  navigateTo() method you can open the Deal Create Page from Account Detail Page.
  • As per the following syntax, you should pass the required parameters, which includes the data needed for the Client Script on Deal Page. In this case the data being passed is the Account Name and Id.
  • Syntax : navigateTo(page, params, data, target)
    • page :  record_create denotes that you want to open Create Page.
    • params :  You need to mention the name of the module for which the Create Page has to be opened. In this case it is "Deals". You can also mention the layout_id and record_id in params. For more details, click here.
    • data : "custom_data" hold the data that you want to pass to the Deals Page.
    • target: You can open the page in same tab or in a different tab using "_self" and "_blank" respectively.
B. Client Script for Deals Module

Now, create another Client Script for "Deals" module with the following details and click "Next".



In the Client Script IDE, add the following script and click "Save"

  1. var a = $Page.navigation_data;
  2. if (a!=null);
  3. {
  4. var field_obj1 = ZDK.Page.getField('Account_Name');
  5. field_obj1.setValue({ "id":a.data_id , "name":a.data });
  6. }

To get the data passed in Account Detail Page, you need to use "$Page.navigation_data". In this script you can use setValue() and mention the id and name of "Account Name". As Account Name is a lookup field, you should mention the Id of the Account along with the Account Name.

Here is how the Client Script Works.


Click here to know more details.

Note:

You can open any external URL using Client Script in a new tab using openURL().



Click here to know more details.

5. Summary :

In this post we have discussed,
  • How to pass data from one page to the other using Client Script.
  • How to perform actions after a record is updated.
  • How to update a record using Client Script without clicking on Save button.
  • How to open external URLs using Client Script.
-------------------------------------------------------------------------------------------------------------------

6. Related Links :


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

Previous Post: Kaizen #141 - Zoho CRM's API Collection in Postman     |     Kaizen Collection: Home
Join us for our upcoming Zoho CRM Developer Series: Zoho CRM APIs, where you can explore more about Zoho CRM APIs. Register Now!  



      • Sticky Posts

      • Kaizen #198: Using Client Script for Custom Validation in Blueprint

        Nearing 200th Kaizen Post – 1 More to the Big Two-Oh-Oh! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
      • Kaizen #197: Frequently Asked Questions on GraphQL APIs

        🎊 Nearing 200th Kaizen Post – We want to hear from you! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
      • Celebrating 200 posts of Kaizen! Share your ideas for the milestone post

        Hello Developers, We launched the Kaizen series in 2019 to share helpful content to support your Zoho CRM development journey. Staying true to its spirit—Kaizen Series: Continuous Improvement for Developer Experience—we've shared everything from FAQs
      • Kaizen #193: Creating different fields in Zoho CRM through API

        🎊 Nearing 200th Kaizen Post – We want to hear from you! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
      • Client Script | Update - Introducing Commands in Client Script!

        Have you ever wished you could trigger Client Script from contexts other than just the supported pages and events? Have you ever wanted to leverage the advantage of Client Script at your finger tip? Discover the power of Client Script - Commands! Commands

        • Recent Topics

        • Is there a way to prevent a user from removing a payment method on a live, recurring subscription?

          As it stands, if you allow users to remove payment methods, they can do so on live subscriptions. This leaves the sub without a payment method. The user should be able to REPLACE the card with a new one, but not remove all payment methods. We have had
        • Multi file upload

          Hi, I just wonder if one could upload multiple files in one shot, say between one and three files, without adding multiple File Upload fields? Thanks, Alalbany
        • Try CRM for everyone button in the way of workflow

          Please consider using the bottom bar for offers. Using the top bar for offers like "Try CRM for everyone" really gets in the way of my day to day workflow.
        • 🚀 WorkDrive 5.0: Evolving from a file sharing app to an intelligent content management platform: Phase 2

          Hello everyone, WorkDrive's primary focus has always been to provide an intelligent and secure content management platform, simplify collaboration, and be the central repository of files for all Zoho apps. In our previous announcement, we unveiled the
        • Function #25: Automatically generate purchase orders from a sales order

          We kicked off the "Function Fridays" series with the goal of helping you automate your everyday accounting tasks. As we delve into today's post, I'm delighted to announce that we're here to present the 25th custom function in this series. While it is
        • Sudden Layout Issue After Last CSS Update for ZML (Temporary Fix Inside)

          Hi, Our clients have noticed today that every section laid out with ZML suddenly shows an unwanted top padding/blank space that interrupts the user screens. It appears that Zoho has changed the default CSS for the .zcp-col.zcp-panel-rowtype-auto element.
        • Search Bar Improvement for Zoho Commerce

          Hey everyone, I've been using Zoho Commerce for a bit now, and I think the search bar could really use an upgrade. Right now, it doesn't show products in a dropdown as you type, which would make finding items a lot faster. On Shopify, for example, you
        • Tabular View Report | Scale To Fit Screen

          Please add the option to scale Tabular View reports to fit the screen. I constantly have to adjust the column size of Tabular View reports to fit various screen sizes and it just looks messy. You can see in the screenshot below there is a blank gap after
        • is it possible to add more than one Whatsapp Phone Number to be integrated to Zoho CRM?

          so I have successfully added one Whatsapp number like this from this User Interface it seems I can't add a new Whatsapp Number. I need to add a new Whatsapp Number so I can control the lead assignment if a chat sent to Whatsapp Phone Number 1 then assign
        • Why Server error in creatiing Landing Pages

          Hi Zoho Team, pls see my screenshot and tell me, what's wrong. Thx
        • Formula Fields inside of Blueprint Transitions

          We would like to have formula fields inside of blueprint transitions. We type in currency fields and would like to see the result inside of a formula field. Our use case: Send out a price for XY 1. Filling out cost fields 2. See gross profit
        • Auto CC - Moving Departments

          We have Auto CC e-mail replies to your support mailbox enabled. We have two departments: Helpdesk (helpdesk@domain.com) Delivery (delivery@domain.com) If we create a Helpdesk ticket, and reply, replies are CC'd to helpdesk@domain.com (OK) We then move
        • How to create a directory report from one-to-many relationship

          Hi all, Newbie here. I'm converting an Access DB to Creator. I've learned Forms are tables and Reports are used to edit table rows, not Forms. I've got the data loaded and can maintain it with the Reports already done. I've done filtering and sorting,
        • Tip 31: How to make a field in a Zoho Creator form mandatory based on criteria

          Hi folks,   I'm sure most of you are familiar with the Mandatory property available in our form builder. It enables you to ensure that your users enter an input in a required field. If they don't enter an input in that field, they'll be unable to submit
        • Assistance Required: Report Export to Excel and WorkDrive Upload via Deluge

          I'm working on automating a scheduled workflow in Zoho Creator that needs to run weekly. The goal is to: Export a report from Zoho Creator in Excel (.xls or .xlsx) format, and Upload the exported file to a specific folder in Zoho WorkDrive using a Deluge
        • Avoiding Inventory Duplication When Creating Bills for Previously Added Stock

          I had created several items in Zoho Books and manually added their initial stock at the time of item creation. However, I did not record the purchase cost against those items during that process. Now, I would like to create Purchase Orders and convert
        • Bulk update account type when adding a bill

          Hi I've only been using Zoho Books for a short while but I'm impressed so far, keep up the great work. One minor issue I'm coming up against is when creating a new bill from a scanned document (supplier invoice). In some cases, the supplier invoice could
        • How to start fresh after many years of using Zoho Books without deleting everything and creating a new organisation?

          Hi, I have used Books since 2016, but never reconciled with my bank account. I was thinking of trying to go back and fix that, but I don't just don't have the time it would take. Instead, I'd like back up my old records and start anew. What is the best
        • How do I modify the the incoming/current call popup? I can modify other call pages but not that one.

          I want to modify the incoming and active call popup on the crm to include customer relevant information, such as purchase history or length of relationship. Under modules and fields, I don't seem to see active call as a choice to modify, only the main
        • Interactions Tab in Zoho CRM: A 360° Omnichannel View of Every Customer Touchpoint

          Hello Everyone, Hope you are well! We are here today with yet another announcement in our series for the revamped Zoho CRM. Today, we introduce Interactions Tab a new way to view all customer interactions from one place inside your CRM account. Customers
        • Canvas: Add Sections to Detail View

          Currently it is only possible to add fields to a canvas detail view. This makes Canvas hard to maintain, because everytime we add a field to our system, someone needs to go into the canvas view and add it there as well. This leads to additional work and
        • Automation#32:Auto Add New Portal Users to the Help Center User Groups

          Hello Everyone, Introducing a custom function that automates the process of adding new portal users to Help Center user groups, making user management effortless! By default, Zoho Desk allows you to assign new portal users to groups manually. But with
        • View Linked Subscription on Invoice list

          When looking at the list of invoices in billing is it possible to see the subscription that an invoice is for. This would allow you to see if it's a subscription a customer is behind on, or they simply haven't paid a one time invoice.
        • Cannot delete old accounts

          Hello, I try to delete old accounts from CRM, but it won't permit, saying documents are still linked to them. I searched in CRM and BOOKS, found some documents and deleted them, but still CRM won't delete them. Any idea how to do that ? I have a lot of
        • Is it possible to Bulk Update 'Product Name' in Zoho Desk?

          Is it possible to Bulk Update 'Product Name' in Zoho Desk? I cannot see that option now. Kindly help how we can do it.
        • Feature Suggestion: Dynamic Browser Tab Icon for Check-in/Check-out Status

          Hello Zoho People Team, I am a regular user of Zoho People, and I believe I have a simple but powerful feature suggestion that would significantly improve the user experience for everyone. The Problem: Our team, and likely many others, sometimes forgets
        • Offline mode on Android TV app?

          Hello! Is there a way to use Zoho Show offline in the Android TV app? I have an Android TV based projector, and I travel with it, and don't want to have to rely on a steady internet connection when giving a presentation.
        • Choice-based Field Rules on Global Lists

          Hi, The new Choice-based Field Rules should also be able to work with Global Lists not just local lists. Thanks Dan
        • Tip #36- How to use Survey in Zoho Assist to capture valuable feedback from remote sessions- 'Insider Insights'

          How to use Survey in Zoho Assist to capture valuable feedback from remote sessions The survey feature allows technicians and customers to share their valuable feedback, contributing to the improvement of remote service quality. After the completion of
        • Assigning multiple roles to a user in Creator

          Hi I find we can assign only one role and permission to an user in creator. There is a requirement to assign multiple roles and corresponding permission to one user. Is there any solution or workaround for this? Refer the screenshot below
        • Improve History Feature in Zoho Inventory

          At present there is a "history" tab on Zoho Inventory Items, however this only shows a date and time stamp along with the users name. It doesn't say what was changed. What is the value of this if you can't see what was changed? My Ideal is to include
        • 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!
        • Update Lead Status in Zoho CRM When a Meeting is Booked via Microsoft Bookings

          Hi everyone, I’m trying to streamline our lead management process and would like to automatically update the Lead Status in Zoho CRM whenever a meeting is booked through Microsoft Bookings. Has anyone successfully implemented this kind of integration
        • Narrative 3 - Comprehending User Management

          Behind the scenes of a successful ticketing system - BTS Series Narrative 3 - Comprehending User Management User management in a ticketing system is how administrators oversee user access, roles, and permissions. This process involves not just creating
        • Payment Schedule

          Please add the ability to create a payment schedule. The other options, like retainer invoices or two invoices, do not work for the customer.  We invoice a client and need to be able to show them everything they owe in one invoice, and when each payment
        • Useful enhancements to Mail Merge in Zoho CRM

          Dear Customers, We hope you're well! We're here with a set of highly anticipated enhancements to the Mail Merge feature in Zoho CRM. Let's go! Mail Merge in Zoho CRM integrates with Zoho Writer to simplify the process of customizing and sharing documents
        • Product Details's Description is lost

          Hi CRM lost its description in Product details subform. Can you make some test before deploy any update?
        • Automatically Hide Unauthorized Sections from Agent Interface in Zoho Desk

          Hello Zoho Desk Team, We hope you're doing well. We’d like to submit a feature request regarding the user experience for agents in Zoho Desk who do not have permission to access certain sections of the system. 🎯 Current Behavior At present, when an agent
        • メール一括配信の未送信のメールについて知りたい

          メール一括配信の後の、未送信のメールの数は添付のようにシステムから連絡がくるのですが それらの対象者を知りたい。レポートなど一覧で知りたい。 また配信対象者なのに(担当者、リード)の メールの履歴に配信したメールの件名でさえ表示されないのはどう理解したらよいのか知りたいです。 また、これらの人をレポートで一覧で出す方法を教えてください。把握したいためです。
        • Zoho Bookings Issues We are facing

          Hi team, Here are list of issues we are facing with Zoho Bookings when migrating from other platforms. Sorry there is a lot but the bookings app need to be functional and practical for people to actually use it and not-cause MORE problems by being so basic and not customisable to each business.  1: SMS reminders for staff  There should be time limits on these reminders to make them useful. EG. if a new booking comes in more than 4 hours from now we don't really need to get a reminder, however if
        • Next Page