You can use the following criteria in your view to fetch records ending in the next 7 days, based on the Expiry date in the form. In the sample code given below, Expiry is the name of the date field in the Sample form which stores the date on which a record expires. To add the criteria to the view definition, select the required view from the Script tab.
list "Sample View" |
Assume you have a form named Sample with a date field that captures the StartDate of a project. To display the records started before 2 weeks, you can add the following criteria to the view in script mode:
list "Sample View" |
In the above statement, zoho.currentdate returns the current date and 'W' stands for week. Refer the topic Operators in Deluge Scripting , for more information on the date & time operators.
Assume you have a form named Sample with field StartDate. If you want to view all the records whose StartDate is the current date, you can create a filter using the zoho.currentdate function, as shown below:
list "Sample View" |
Assume you have a Date field in your Form called Date_1 which stores the date when the Employees enter their TimeSheet. Add another field to your Form say DateInfo to store the week and the year of the date. This is achieved by writing On User Input script to the Date_1 field, as given below.
To update the DateInfo field with the week and year of the Date_1 field, write
//to get the week and year entered in the form and update it in the Dateinfo field |
In the view, specify the criteria as given below.
list "Sample View" |