CodeX Scripts - Intro | Online Help | Zoho Projects

CodeX Scripts - Intro

CodeX Scripts let you define custom logic that runs automatically when users interact with default modules such as tasks, projects, time logs. It allows users to control how the module behaves based on certain conditions. Users can write scripts using JavaScript SDKs to trigger actions before or after a record is created or updated. Users with CodeX Scripts permission can configure and manage CodeX Scripts.
InfoCodeX Scripts are supported in all data centers except CN JP and AE.

Benefits

  1. Validate conditions and prompt custom restriction messages within the project and task module.
  2. Connect with external apps using HTTP requests.
  3. Automatically update tasks or project details based on conditions.
  4. Retrieve and update other project records in your portal.

How CodeX Scripts differ from Custom Functions?

Zoho Projects provides two ways to add custom logic, CodeX Scripts and Custom Functions. While both allow users to extend system behavior, they are designed for different purposes.

CodeX Scripts
  1. Written in JavaScript using the CodeX SDK.
  2. Runs automatically based on record events such as before or after a task/project is created, updated, or deleted. 
  3. Used to validate conditions, restrict actions, or control how the module behaves.
  4. Suitable for enforcing process rules or validations at organization level.
 Custom Functions
  1. Written in Deluge. Learn more.
  2. Used to automate actions, such as updating records, sending notifications, or integrating with external services.
  3. They can also be associated with workflow rules or task blueprints to trigger actions based on the criteria.
For example, in a project, if you want to restrict your project members from creating subtasks for a closed task or an active task, you can use the CodeX Scripts to write in the code using the objects and the methods, to execute on a trigger such as "Before Create" and save.

Script:


This will prompt your project members with an alert that the subtasks cannot be created for this task when the user tries to create a subtask.

Execution:

 
Code used in this case:
  1. function main() { 
  2.      let task = current.record; 
  3.      /** 
  4.       *  
  5.       * @type Number 
  6.       */ 
  7.      let startDate = task.start_date; 
  8.      Logger.info('Parent ID: ' + task.parent_task); 
  9.      Logger.info('Root Task ID: ' + task.root_task); 
  10.    
  11.      // console.log(JSON.stringify(variables.blockSubTasks)); 
  12.      if(task.parent_task || task.root_task) { 
  13.          Logger.info("Subtask creation is disabled"); 
  14.          throw new ScriptError("You cannot create a subtask");      
  15.      }   
  16.  } 
Find other CodeX scripts to customize how task and project module should operate.


        Create. Review. Publish.

        Write, edit, collaborate on, and publish documents to different content management platforms.

        Get Started Now


          Access your files securely from anywhere

            Zoho CRM Training Programs

            Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

            Zoho CRM Training
              Redefine the way you work
              with Zoho Workplace

                Zoho DataPrep Personalized Demo

                If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

                Zoho CRM Training

                  Create, share, and deliver

                  beautiful slides from anywhere.

                  Get Started Now


                    Zoho Sign now offers specialized one-on-one training for both administrators and developers.

                    BOOK A SESSION







                                Quick LinksWorkflow AutomationData Collection
                                Web FormsEnterpriseOnline Data Collection Tool
                                Embeddable FormsBankingBegin Data Collection
                                Interactive FormsWorkplaceData Collection App
                                CRM FormsCustomer ServiceAccessible Forms
                                Digital FormsMarketingForms for Small Business
                                HTML FormsEducationForms for Enterprise
                                Contact FormsE-commerceForms for any business
                                Lead Generation FormsHealthcareForms for Startups
                                Wordpress FormsCustomer onboardingForms for Small Business
                                No Code FormsConstructionRSVP tool for holidays
                                Free FormsTravelFeatures for Order Forms
                                Prefill FormsNon-Profit

                                Intake FormsLegal
                                Mobile App
                                Form DesignerHR
                                Mobile Forms
                                Card FormsFoodOffline Forms
                                Assign FormsPhotographyMobile Forms Features
                                Translate FormsReal EstateKiosk in Mobile Forms
                                Electronic Forms
                                Drag & drop form builder

                                Notification Emails for FormsAlternativesSecurity & Compliance
                                Holiday FormsGoogle Forms alternative GDPR
                                Form to PDFJotform alternativeHIPAA Forms
                                Email FormsFormstack alternativeEncrypted Forms

                                Wufoo alternativeSecure Forms

                                TypeformWCAG

                                  Zoho FSM Video Tutorials


                                        All-in-one knowledge management and training platform for your employees and customers.

                                                  Create. Review. Publish.

                                                  Write, edit, collaborate on, and publish documents to different content management platforms.

                                                  Get Started Now




                                                                    You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                                        Manage your brands on social media


                                                                          • Desk Community Learning Series


                                                                          • Digest


                                                                          • Functions


                                                                          • Meetups


                                                                          • Kbase


                                                                          • Resources


                                                                          • Glossary


                                                                          • Desk Marketplace


                                                                          • MVP Corner


                                                                          • Word of the Day


                                                                          • Ask the Experts


                                                                            Zoho Sheet Resources

                                                                             

                                                                                Zoho Forms Resources


                                                                                  Secure your business
                                                                                  communication with Zoho Mail


                                                                                  Mail on the move with
                                                                                  Zoho Mail mobile application

                                                                                    Stay on top of your schedule
                                                                                    at all times


                                                                                    Carry your calendar with you
                                                                                    Anytime, anywhere




                                                                                          Zoho Sign Resources

                                                                                            Sign, Paperless!

                                                                                            Sign and send business documents on the go!

                                                                                            Get Started Now




                                                                                                    Zoho TeamInbox Resources





                                                                                                              Zoho DataPrep Demo

                                                                                                              Get a personalized demo or POC

                                                                                                              REGISTER NOW


                                                                                                                Design. Discuss. Deliver.

                                                                                                                Create visually engaging stories with Zoho Show.

                                                                                                                Get Started Now








                                                                                                                                    • Related Articles

                                                                                                                                    • CodeX Scripts for Time Logs

                                                                                                                                      CodeX Scripts in Zoho Projects are advanced conditional logic scripts that help enforce specific rules and validations. Users can control how and when time logs can be created, updated, blocked or transitioned. Use Cases Restrict Time Logs Based on ...
                                                                                                                                    • Working with CodeX Scripts

                                                                                                                                      CodeX Scripts allows users to define custom logic that runs automatically based on events in the default modules such as when a project, task and time log is created, updated, or deleted. These scripts help enforce validations, restrict actions, or ...
                                                                                                                                    • CodeX Scripts for Projects

                                                                                                                                      CodeX Scripts in Zoho Projects are advanced conditional logic scripts that help enforce specific rules and validations. Users can control how and when a project can be created, edited, or transitioned. This ensures better compliance and process ...
                                                                                                                                    • CodeX Scripts for Tasks

                                                                                                                                      CodeX Scripts in Zoho Projects are advanced conditional logic scripts that help enforce specific rules and validations. Users can control how and when tasks can be created, edited, or transitioned. This ensures better compliance and process ...
                                                                                                                                    • JavaScript SDK for CodeX Scripts

                                                                                                                                      Codex Scripts in Zoho Projects allow users to customize how the projects and tasks operate. Using these scripts, users can automate validations and actions, integrate external systems, and retrieve or update the data. CodeX Scripts are supported in ...
                                                                                                                                      Wherever you are is as good as
                                                                                                                                      your workplace

                                                                                                                                        Resources

                                                                                                                                        Videos

                                                                                                                                        Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                                                        eBooks

                                                                                                                                        Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                                                        Webinars

                                                                                                                                        Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                                        CRM Tips

                                                                                                                                        Make the most of Zoho CRM with these useful tips.



                                                                                                                                          Zoho Show Resources