A record is a row of data submitted through a Form. In the topic,"Form Types" we have learnt that Zoho Creator supports two types of Forms - Normal Forms and Stateless Forms. The data submitted through a Normal Form will be directly added to the relevant table in your database.
Who can add records?
1. Write/Paste Data from the XLS file.
2. Import Data from the XLS files by specifying the file name.
Refer the topic Import and Export Data for more information.
Note:Zoho Creator automatically updates the Added time and the Added User's Name and IP address, for each record added to the database.
1. Restrict entries to a form by everyone except the admin user
In the following code, Added_User stores the name of the user who added the current record and zoho.adminuser returns the name of the admin user. If the added user name is not equal to the admin user name, the record will not be added. The code is added on add ->validate block of the Script tab.
Zoho Creator automatically tracks details about when and by whom a record was added or modified using the fields Added User, Added Time, Modified User and Modified Time. This information will be displayed in the view, if the columns are selected from Column Properties option of the View tab in Edit mode. Refer the topic, Display User name and time, for more information.
2. Restrict entries to my Registration Form based on a given date
Assume you have a Registration form to register for a specific course and the registration is open till 30th Dec 2009. To restrict entries from being submitted after this date, use the zoho.currentdate variable within the on add ->on validate block of the Script tab, to validate if the registration date has expired. The sample code is given below.