Client Script Commands

1. What are Commands?
 

Commands are another dimension of Client Script that enables users to trigger them anytime and anywhere in CRM, extending their event-driven functionality beyond just specific modules and pages. The user can either use custom keyboard shortcuts or command palette to execute Client Script Commands.

Let's explore a sample scenario to demonstrate how Client Script Commands work.


Consider Sales Advisors at a Finance Consulting Company having time-consuming and repetitive tasks during client calls. The Manager is on the lookout for ways to streamline these tasks and minimize clicks. Since the sales advisors frequently use an EMI calculator each day, the admin decides to find a solution that allows the calculator to be displayed for the Sales  Advisors’ convenience. 


To open the EMI calculator in any page of Zoho CRM, the Sales Advisor simply clicks the command palette icon in the footer and selects "EMI Calculator".Here is how the Client Script Command works.

Alternatively, he can also use keyboard shortcut to trigger the EMI Calculator. Here, the EMI Calculator in this scenario is built using Widgets and rendered as a flyout

2. How to create a Command? 

  • You can create a Command by specifying the Category as Commands (instead of module) while creating a Client Script.

Note
You can create upto 30 Client Script Commands.

3. How to trigger a Command?

 To trigger a Command, you can use one of the following ways.

3.A. Using Command Palette 
3.B. Using Keyboard shortcuts   

3.A. Using Command Palette 

  • You can see the Command Palette icon on the footer as shown below.

  •  Click on this Command Palette icon and select the name of the Command that you want to trigger.
  • You can see that the Command executes on that page.

  • You can use the keyboard shortcut (by default, it is C C) to open the Command Palette instead of clicking on the icon in the footer.

3.B. Using keyboard shortcuts 

  • You can also link each of the Commands to a shortcut key and trigger a Command using that designated shortcut key. Each user can set specific shortcuts based on individual preference and use them to trigger a Command.
  • To access keyboard shortcuts, navigate to Setup  > General > Personal Settings > Keyboard Shortcuts. Keyboard shortcuts are disabled by default for all accounts. Users have to enable them manually. Click here to know more about Keyboard Shortcuts
  • You can see a section named "Commands".
  • Click "Choose Command".
  • Select the Command for which you want to configure a keyboard shortcut.
  • Enter the Shortcut and click Add shortcut.
  • In the below gif, the shortcut configured is Cmd E . So, whenever the user presses Cmd + E the corresponding Client Script Command will get triggered.
     

Note :

  • Every user can assign their preferred shortcut keys to trigger Commands.
  • The "Manage" option  in the "Commands" section will be visible to those with "Manage Extensibility Permission." Clicking on it will redirect the user to the Client Script Commands Tab.
  • Keyboard shortcuts configured for a command by all users in an organization will be deleted when the respective Client Script Command is disabled or deleted.