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!  



      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


          • 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

          Zoho CRM Plus Resources

            Zoho Books Resources


              Zoho Subscriptions Resources

                Zoho Projects Resources


                  Zoho Sprints Resources


                    Zoho Orchestly Resources


                      Zoho Creator Resources


                        Zoho WorkDrive Resources



                          Zoho CRM Resources

                          • CRM Community Learning Series

                            CRM Community Learning Series


                          • Tips

                            Tips

                          • Functions

                            Functions

                          • Meetups

                            Meetups

                          • Kbase

                            Kbase

                          • Resources

                            Resources

                          • Digest

                            Digest

                          • CRM Marketplace

                            CRM Marketplace

                          • MVP Corner

                            MVP Corner




                            Zoho Writer Writer

                            Get Started. Write Away!

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

                              Zoho CRM コンテンツ






                                ご検討中の方

                                  • Recent Topics

                                  • Making money out of Zoho Sheets - How?

                                    Hello, Suppose I come up with a brilliant Zoho Sheet that I want to sell to other people, can I do this? How? Thanks.
                                  • Adding Columns to Reports

                                    Hi, Is it possible to choose fields to be added as columns in the reports? Thank you.
                                  • 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.
                                  • What are people using to send Service based emails?

                                    Zoho Campaigns is for marketing. Users can unsubscribe from these emails. Service based emails need to be delivered and can without the worry of Can-spam act. What are people using to send service based emails? My mailing list is derived from a database
                                  • Client Script also planned for Zoho Desk?

                                    Hello there, I modified something in Zoho CRM the other day and was amazed at the possibilities offered by the "Client Script" feature in conjunction with the ZDK. You can lock any fields on the screen, edit them, you can react to various events (field
                                  • Introducing Zoho Commerce 2.0 — It's more than just selling!

                                    Hello! We are proud to launch Zoho Commerce 2.0, a reimagination of how online businesses look, feel, and function. This launch is both timely and symbolic, as we reaffirm our commitment to empowering small and medium enterprises with powerful, yet simple-to-use
                                  • Kits: Option to Hide Associate Items on Documents

                                    The new Kit type of Composite Item is very helpful, and we're already using it in several different ways. One problem is that there seems to be no way to hide the components on some documents, including Package Slips. There is an option given in settings
                                  • Unable to display field label from a hidden Single Line Textbox in Description

                                    Hi folks, I'm unable to display my hidden field, e.g. ${zf:SingleLine4} , in my description. I'm pre-filling this hidden Single Line Text box via "Field Alias - Pre-fill URL" settings. I noticed that my decimal form fields work, e.g. ${zf:Decimal}, and
                                  • An Exclusive Session for Zoho Desk Users: AI in Zoho Desk

                                    A Zoho Community Learning Initiative Hello everyone! This is an announcement for Zoho Desk users and anyone exploring Zoho Desk. With every nook and corner buzzing, "AI's here, AI's there," it's the right time for us to take a closer look at how the AI
                                  • Email for customer to provide payment information

                                    Is there a way for customers when you set up a subscription to get an email that prompts them to put in their billing information to start their subscription? Also, can you show the subscription in their portal?
                                  • Ticket Automatically Created from Closed Chat

                                    Is there a way to prevent a ticket being create for every chat.... or at the very least have it automatically closed.
                                  • I want to Show the product list based on the drop Down

                                    in quotation app , amc form form i have Department drop down field and in subform i have loop up field item description taken from the anothe app PRO I want to show the product list look up based on the deparment selected example if they selected deparment
                                  • Bad User: Authenticated but not connected

                                    Zoho CRM cannot send/receive emails and it appears as if it may be an api configuration change either via Zoho or MS. Does anyone have information on how to fix this error message? I am admin on all my accounts. Zoho and MS are blaming each other.
                                  • Zoho + ERP (SAP)

                                    First of all: I'm using Zoho CRM and I have complete right that it's a brilliant solution for sales force. But, in my new job, doesn't exist a CRM system and I want propose Zoho CRM. In the company, we're using a ERP (SAP), a few time ago. I would like to know about integration between Zoho CRM and ERP (SAP), as possible? How I can do that? Regards, Renato Lima
                                  • Lookup fields

                                    Is there any way to add Lookup fields to Zoho FSM -- I do not see the option but I see default lookup fields in different modules
                                  • Sort data in Pivot Table

                                    Is it possible to sort by a data field. I can gruop and filter, but I culdn't find how to sort the results. Tank You.
                                  • Inventory Barcode Creation - Add Picture of Item

                                    Hi I am trying to set up bar code labels and include a picture of the item on the label - any idea on how to add that field to the barcode generator?
                                  • Shared Snippets Everyone

                                    Hi, Now that the Shared Snippets have been released and I think will be the most used feature implemented in 2023 :) Creating and Using Snippets in Ticket Responses - Online Help | Zoho Desk Maintain consistency in ticket responses with shared snippets
                                  • Please Enable Snippets for Agents Adding Comments

                                    Snippets and templates are currently enabled for agents when they use the reply functionality. There is currently no way to add a template or snippets when an agent comments. This is really weird. Our agents don't use the reply functionality, only the
                                  • Topics assigned to Contacts in Campaigns

                                    I have yet to find an efficient way to assign topics to contacts in campaigns with the new system in place.  We have daily contacts added to our system through various forms and we have to manually go in and add topics to contacts before each email campaign
                                  • CRM Email Insights Not Working - Status not Changing

                                    I used to be able to see if a customer opened/read an email in CRM, but I no longer get those status changes inside their record. I have everything enabled and I am sending the email from CRM. The experience center has the status' enabled as well. Any
                                  • Product and Service

                                    Hi guys, there is a difference between layout of product and service if Long Description field have some kind of text. Please see screenshot 1 for Service here: https://prnt.sc/7xWwPKd29nWP for Product here: https://prnt.sc/LGmtVd_U6H7q As you can see
                                  • The Urgent Need for Native Brazilian Payment Integrations: PIX and Direct Bank Connections

                                    Hello Zoho Team, I am writing to emphasize a critical functionality gap for Zoho Books in the Brazilian market: the lack of modern, native payment gateway integrations. The current options are insufficient. The Mercado Pago integration, for instance,
                                  • Better implementation of Item Category on Invoices and Estimates

                                    1) I have added Item Category as a custom field. Honestly, this should be a native part of the item itself, and either required, optional, or not used.  2) When entering an item on an invoice, you have to enter the first character(s) of the item, otherwise
                                  • 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.
                                  • Zoho CRM email formatting issues

                                    I have been having a hard time with formatting email templates. It feels like Zoho email is "fighting my edits." It refuses to change size, font, etc. Sometimes, the template looks great, then when the email gets sent, it looks completely different- some
                                  • Weekly Tips : Seamlessly collaborate with Share Drafts in Zoho Mail

                                    Ever found yourself stuck wondering how to get input on an important email draft without actually sending it? Maybe you want a teammate’s feedback or approval from your manager—without exposing sensitive info. Or perhaps you are working across different
                                  • How to Share a workdrive folder outside organization ?

                                    Hi, Earlier we were using Google Suite and were able to share the google drive folders with external organization ( Auditors , marketing collaterals ) as most of them had a personal gmail account they were able to access it without any issue. How can
                                  • Zoho CRM Account Duplication via Credit Application Form

                                    Hi, We send a credit application link to our customers via email, which is managed through Zoho Campaigns. When a customer submits the form, it automatically creates a new account in Zoho CRM. We would like to know how to stop this from creating duplicate
                                  • 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
                                  • Flexible Milestone Invoicing

                                    If your Zoho Projects portal is integrated with Zoho Invoice/Books, you can now create an invoice for your milestones. You can enable it under Integration Preference and invoice milestones regardless of the project's billing type. For instance, consider
                                  • The get records i am getting produts that show in the show in the sub form item list field

                                    The get records i am getting produts that show in the show in the sub form item list field if(input.Department != null) { // Get filtered records once creator_ptid = zoho.creator.getRecords("harshadgroup","item-master","All_Products","Department == \""
                                  • Incorrect Handling of XLSX data

                                    Trying to import an XLSX schedule of bills into Zoho Books I ran across the problem of date formatting. To replicate: Build a CSV file with bill dates in whatever format you like and import it - this should work if you match the "dd/MM/yyy" etc. format
                                  • Add Zoho Form Submission as Attachment to Zoho CRM Deal using Zoho Deal ID

                                    Hi Zoho team, I have a Zoho Form in which one of the fields will be hidden but will be defaulted with the Zoho Deal ID. Once the form is submitted, I want to reattach the submitted form (and another uploaded file field) into Zoho CRM Deals record. The crazy part is that Deal Name and Stage are the only two fields available for mapping. I have the actual Deal ID. Why can't I just use that. Can you please fix it so that I can properly attach the submission using Zoho Deal ID instead of name/stage (which
                                  • 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
                                  • Displaying related quotes in sales order and back

                                    Hi, My colleague liked to see to which sales orders, the quote has been converted. Quote shows Invoices, but not SO. Same, they would like to see the quotes in the sales order, as they can see invoices, packages, shipment, How can we achieve this ? Thank
                                  • Payment link showing as malicious

                                    We've had a few customers who have been unable to pay invoices as the payment link (the domain is zohosecurepay.eu) is showing as a malicious website in their browser. Could anyone help with this please?
                                  • Side bar menu

                                    It would be great if you could stop the auto collapse of expanded menus when selecting a different module. It would save a lot of mouse clicks for a lot of users that frequently switch between sales & purchases as we do, it's easier to collapse them manually when not required !
                                  • Export Invoices to XML file

                                    Namaste! ZOHO suite of Apps is awesome and we as Partner, would like to use and implement the app´s from the Financial suite like ZOHO Invoice, but, in Portugal, we can only use certified Invoice Software and for this reason, we need to develop/customize on top of ZOHO Invoice to create an XML file with specific information and after this, go to the government and certified the software. As soon as we have for example, ZOHO CRM integrated with ZOHO Invoice up and running, our business opportunities
                                  • Multiple Respondents for One Survey Submission?

                                    Does anyone know of a way to allow multiple respondents to complete only one  survey and then also see (while completing the survey) the responses for their fellow colleagues who already answered that question? The situation is that our new customers have within their own organization, multiple employees that will need to assist in the one survey response. Since we don't always know which new respondent is the "who" that will have the answer, we need multiple respondents to be able to view the response
                                  • Next Page