Overview
In the topic Zoho Creator URL Patterns we learned about the default URLs to access a Zoho Creator application and its forms, views and report formats. In this topic we will learn about the Functionality based URLs to set default values for form fields, edit individual records by passing record ID in the URL, set criteria for views and print a view.
Functionality based URLs
To set default values for form fields
The default values for form fields can be set by passing additional parameters to the form URL. For example, to automatically load a value for Employee ID field in http://creator.zoho.com/zchelp/employee-manager/#Form:Employee the default value is passed as querysting (Employee_ID=1234) to the url, where Employee_ID is the script name of the field in your form.
The form url with query string will be, http://creator.zoho.com/zchelp/employee-manager/#Form:Employee?Employee_ID=1234
Note: The default field value will be available in the form's on load action.
To edit individual records by passing record id in the URL
The url to view and edit individual record using its record ID is given below. This will display the zoho creator form in edit mode.
http://creator.zoho.com/<userName>/<applinkname>/#Form:<formlinkname>?recLinkID=<recordID>&viewLinkName=<viewlinkname> |
Refer the topic Editing Records via Record ID for more information,
To set criteria for a view
The criteria for a view can be passed as part of a query string to a view url. Multiple criterias are specified by appending it along with the URL using '&'
URL format for setting criteria with "=" (Equal) operator is given below:
| http://creator.zoho.com/<app owner name>/<app name>/#View:<view name>?<FieldName1>=<FieldName1 Value> &<FieldName2>=<FieldName2 Value> |
where,
FieldName1 & FieldName2 are the Deluge script names for the field in the form and multiple criterias are specified by appending it along with the URL using & operator.
Example:
The view http://creator.zoho.com/zchelp/employee-manager/#View:Employee_View lists all the records in the Employee View. To view records with Name EQUALs Henry and Employee ID EQUALs 1234, we need to pass the field name and value as querystring. The complete url for this example is,
http://creator.zoho.com/zchelp/employee-manager/#View:Employee_View?Name=Henry&Employee_ID=1234
URL format for setting criteria with operators other than "=" (Equal)
| http://creator.zoho.com/<app owner name>/<app name>/#View:<view name>?<FieldName1>=<FieldName1 Value>&<FieldName2>=<FieldName2 Value>&<FieldName1_op>=<constant>&<FieldName2_op>=<constant> |
where,
FieldName1 & FieldName2 are the Deluge script names for the field in the form.
FieldName1_op & FieldName2_op are parameter names for the operator (fieldname appended by _op).
constant is the value assigned for each operator. Refer the table to view the list of all operators and their constants.
Example1:
The view http://creator.zoho.com/zchelp/employee-manager/#View:Employee_View lists all the records in the Employee View. To view records with Employee ID GREATER_THAN 1235, we need to pass the field name, value, parameter name for the operator and its value as querystring. The parameter name for Employee_ID is Employee_ID_op and the constant for GREATER_THAN is 21.
The complete url for this example is,
http://creator.zoho.com/zchelp/employee-manager/#View:Employee_View?Employee_ID=1235&Employee_ID_op=21
Example2:
The URL to view records with EmailID ENDS_WITH zoho.com and Roles CONTAINS Supports,
http://creator.zoho.com/zchelp/employee-manager/#View:Employee_View?EmailID=zoho.com&EmailID_op=25&Roles=Support&Roles_op=26
URL format for setting criteria with (between) operator
| http://creator.zoho.com/<app owner name>/<app name>/#View:<view name>?<FieldName1>=<StartingRangeValue>;<EndingRangeValue>&<FieldName1_op>=<BETWEEN Constant> |
where,
<StartingRangeValue> and <EndingRangeValue> can be any number, decimal or date.
Example1: The url to view records with Date_of_Joining between any two dates is given below. Here, Date_of_Joining is a date field.
http://creator.zoho.com/zchelp/employee-manager/#View:Employee_View?Date_of_Joining=18-Jan-2006;30-Apr-2007&Date_of_Joining_op=58
Example2: The url to view records between any two Employee_ID numbers is given below. Here Employee_ID is a number field.
http://creator.zoho.com/zchelp/employee-manager/#View:Employee_View?Employee_ID=1235;1238&Employee_ID_op=58
List of Operators and their Constants
S. No | Operator | Constant |
1
| EQUAL
| 18
|
2
| NOT_EQUAL
| 19
|
3
| LESS_THAN
| 20
|
4
| GREATER_THAN
| 21
|
5
| LESS_EQUAL
| 22
|
6
| GREATER_EQUAL
| 23
|
7
| STARTS_WITH
| 24
|
8
| ENDS_WITH
| 25
|
9
| CONTAINS
| 26
|
10
| NOT_CONTAINS
| 27
|
11
| LIKE
| 28
|
12
| EMPTY
| 29
|
13
| NOT_EMPTY
| 30
|
14
| YESTERDAY
| 31
|
15
| TODAY
| 32
|
16
| TOMORROW
| 33
|
17
| LAST_7_DAYS
| 34
|
18
| LAST_30_DAYS
| 35
|
19
| LAST_60_DAYS
| 36
|
20
| LAST_90_DAYS
| 37
|
21
| LAST_120_DAYS
| 38
|
22
| NEXT_7_DAYS
| 39
|
23
| NEXT_30_DAYS
| 40
|
24
| NEXT_60_DAYS
| 41
|
25
| NEXT_90_DAYS
| 42
|
26
| NEXT_120_DAYS
| 43
|
27
| LAST_MONTH
| 44
|
28
| THIS_MONTH
| 45
|
29
| NEXT_MONTH
| 46
|
30
| CURR_PREV_MONTH
| 47
|
31
| CURR_NEXT_MONTH
| 48
|
32
| TRUE
| 49
|
33
| FALSE
| 50
|
34
| LAST_YEAR
| 51
|
35
| CURRENT_YEAR
| 52
|
36
| NEXT_YEAR
| 53
|
37
| PREVIOUS_2_YEAR
| 54
|
38
| NEXT_2_YEAR
| 55
|
39
| CURRENT_PREVIOUS_YEAR
| 56
|
40
| CURRENT_NEXT_YEAR
| 57
|
41
| BETWEEN
| 58
|
To print a view
The url format to print a view is given below:
| http://creatorexport.zoho.com/<app owner name>/<app name>/print/<view name> |
For example:
http://creator.zoho.com/zchelp/employee-manager/print/Employee_View
To print a view with criteria
URL format to print a view with criteria, using "=" (Equal) operator
| http://creatorexport.zoho.com/<app owner name>/<app name>/print/<view name>/<FieldName1>=<FieldName1 Value>&<FieldName2>=<FieldName2 Value> |
For example, the url to print employee records belonging to the "Engineering" department
http://creator.zoho.com/zchelp/employee-manager/print/Employee_View/Department=Engineering
URL format to print a view with criteria, other than "=" (Equal) operator
| http://creatorexport.zoho.com/<app owner name>/<app name>/print/<view name>/<FieldName1>=<FieldName1 Value>&<FieldName2>=<FieldName2 Value>&<FieldName1_op>=<constant>&<FieldName2_op>=<constant> |
where,
FieldName1 & FieldName2 are the Deluge script names for the field in the form.
FieldName1_op & FieldName2_op are parameter names for the operator (fieldname appended by _op).
constant is the value assigned for each operator. Refer the table to view the list of all operators and their constants.
Example:
To URL to print records with Employee ID GREATER_THAN 1235,
http://creator.zoho.com/zchelp/employee-manager/print/Employee_View/Employee_ID=1235&Employee_ID_op=21
URL format to print a view with criteria, using "between" operator
| http://creatorexport.zoho.com/<app owner name>/<app name>/print/<view name>/<FieldName1>=<StartingRangeValue>;<EndingRangeValue>&<FieldName1_op>=<BETWEEN Constant> |
where, <StartingRangeValue> and <EndingRangeValue> can be any number, decimal or date.
Example:
The url to print records with Date_of_Joining between any two dates is given below. Here, Date_of_Joining is a date field.
http://creator.zoho.com/zchelp/employee-manager/print/Employee_View/Date_of_Joining=18-Jan-2006;30-Apr-2007&Date_of_Joining_op=58
To print a HTML view with parameter
The URL format to print a HTML view with parameter is given below,
| http://creatorexport.zoho.com/<app owner name>/<app link name>/print/<view name>/<paramName>=<paramValue> |
where,
paramName is the name of the parameter defined in the HTML view.
paramValue is the value passed to the parameter defined in the HTML view.
Example:
The url to print a HTML view named "TestHTML" with paramName "dept" and paramValue as "Engineering" is given below. Here, the paramName "dept" is the name of the parameter defined in the HTML view to fetch records with the specified paramValue.
http://creator.zoho.com/zchelp/employee-manager/print/TestHTML/dept=Engineering
Converting HTML view to PDF
URL Format
The url format to convert an HTML view to PDF is given below:
| http://creatorexport.zoho.com/<app owner name>/<app link name>/pdf/<HTML view link name> |
The url format to convert an HTML view to PDF with output file name:
http://creatorexport.zoho.com/<app owner name>/<app link name>/pdf/<HTML view link name>/&zc_FileName=<output file name>
|
|
| Note:
If no 'zc_pdf_filename' parameter is passed, then by default 'view display name' will be chosen as file name.
|
The url format to convert an HTML view to PDF with parameter:
http://creatorexport.zoho.com/<app owner name>/<app link name>/pdf/<HTML view link name>/&<paramName>=<paramValue>
|
where,
paramName is the name of the parameter defined in the HTML view.
paramValue is the value passed to the parameter defined in the HTML view.
Examples
- PDF Link: http://creatorexport.zoho.com/zohocreator/customer-support/pdf/Most_Recent_Solution
- PDF Link with file name: http://creatorexport.zoho.com/zohocreator/customer-support/pdf/Most_Recent_Solution/&zc_FileName=ReportFor_Oct26
- PDF Link with arguments: http://creatorexport.zoho.com/zohocreator/customer-support/pdf/More_Details_Html_View/&ticketID=104
where, ticketID is the name of the parameter defined in the HTML view.
- PDF Link with arguments and file name:http://creatorexport.zoho.com/zohocreator/customer-support/pdf/More_Details_Html_View/&ticketID=104&zc_FileName=ReportFor_Oct26
where, ticketID is the name of the parameter defined in the HTML view.
Limitation
- Div embedded forms/views inside the HTML view is not supported as already discussed in this Forum post. (Will be done only after we provide #include support. i.e server side include directive in deluge. Users will have to change to the new implementation once done to enable PDF output).
- Any authenticated content like images/css that requires your current credential will not be supported. i.e Any link/embedding in the HTML to be converted pdf should be public content.
- Any css/images and other links to be rendered have to be specified in full path. For example, /images/xyz.jpg will not be properly rendered. But http://creator.zoho.com/images/xyz.img will be properly rendered.
How do I use the 'between' command to set a date range?
The URL format to use the 'between' command to set a date range is updated in this document.
his seems like a nice method of setting criteria for people like me who don't know what to type in that blank "set criteria" window... but I'm struggling to use this too.
How would we specify records between the current date and a date in the future? Say, between today and May 31, 2009?
Refer the following link:
http://forums.zoho.com/?ftid=2266000000273067