CodeX Scripts in Zoho Projects are conditional logic scripts that enforce your own rules and validations. For time logs, they let you control how and when logs can be created, updated, blocked, or moved on. Where the built-in time log restrictions are not specific enough, a CodeX Script can express almost any rule your team needs.
Zoho publishes ready-made example scripts for ten common rules. Each one checks the time log or logs being saved and, if any break the rule, rejects them and returns a list of violations that names the log, the user, and the reason. Several of the examples look up task details through the Zoho Projects API, and the holiday and leave examples read from Zoho People, so they depend on connections to those services being in place. Zoho's page holds the full code for each. This article describes what every script does so you can pick the right starting point.
| Rule | What it does |
|---|---|
| Restrict logs by task work hours | Stops users logging more time than the total work hours allocated to a task. It also blocks logging against tasks that have no work hours assigned. |
| Restrict logs for unassigned tasks or issues | Allows logging only against tasks or issues that have at least one owner. Logs against unassigned work items are rejected. |
| Restrict weekend logs | Blocks time logged on Saturdays and Sundays by checking the selected log date. |
| Restrict logs on holidays | Blocks entries on organisation holidays, using holiday information retrieved from Zoho People. |
| Restrict logs during leave or time off | Stops users logging time on days they are on approved leave, using leave records from Zoho People. |
| Allow logs only for task or issue owners | Only users assigned as owners of a task or issue can log time against it. Unassigned work and unauthorised users are blocked. |
| Restrict logs for tasks in review | Stops logging against tasks whose status is In Review, so time is recorded only during active execution. |
| Restrict general time logs | Blocks general logs that are not linked to a task or issue, so every entry is tied to a work item. |
| Restrict logs to the current day | Allows logging only for today's date, blocking both backdated and future-dated entries. |
| Restrict logs for tasks | Stops logging against tasks entirely. Useful where time may be logged only against issues or as general logs. |