When a project involves processes beyond the usual modules such as tasks and issues, teams often create Custom Modules to keep information organized in a way that fits their workflow. Once those records become part of the process, there may also be specific conditions that need to be followed while creating or updating them.
For example, a real estate team uses a Lease custom module to manage lease agreements for its properties.
The team follows the policy: the security deposit for every lease must be at least three times the monthly rent.
A lease with a monthly rent of 200,000, for instance, must have a security deposit of at least 600,000. With multiple leases being created, relying on users to manually verify this requirement can result in records that don't follow the policy.
The team can create a CodeX Script for the Lease custom module with the Before Create event. The code used for this case is attached below.
When the security deposit meets the requirement, the Lease record is created normally. When it falls below the required amount, the CodeX Script will not allow users to create a lease and displays the policy.
This helps teams keep the rules defined for their Custom Modules consistent with the records they create.
We hope you found this post helpful. If you have any questions, drop your comment below or email us at support@zohoprojects.com.