openUrl
Table of ContentsUp
- Zoho Creator
- Zoho CRM
- Zoho Books
- Zoho Billing
- Zoho Invoice
- Zoho Inventory
Overview
The open url deluge task when executed takes the user to the specified url.
The URL can also be opened in iframe. Support for iframe provides huge opportunities for developers to improve the interface/interaction of their applications and provide Web 2.0 (AJAX) like experience to their users where parts of the Web Page can be refreshed with new data from the server without having to repaint the entire screen space.
Note:
openUrl() is a terminal statement and will execute only the last openURL task when configured more than once.
The openURL task will not be executed, if a user defined function (with the openUrl task) is invoked from a custom action that is placed in the View header and type is set as execute action for each record.
Reason: A custom action placed in the view header can be invoked on all or specific records in a view. Hence, if a custom action that executes the openURL task is invoked on all or many number of records in a view, it will open that many browser windows. A user who invokes this custom action may sometimes not be aware of the actual reason for this behaviour. Hence, openURL task is not supported when the custom action is placed in the view header.
Syntax
openUrl(<URL>, <window>, [optional_param]);
where:
Parameter | Data type | Description |
<URL> | TEXT | URL or the Zoho Creator's URL param that will be opened. Examples for Zoho Creator's URL param: #Form:form1, #Report:report1 Note:
|
<window> | TEXT | The type of window in which the URL will be opened. Applicable values:
Note: Only Zoho Creator's URL params can be opened in a popup window. If this param is supplied with "popup window" and the <URL> param is not a Zoho Creator's URL param, the specified URL will be opened in a new window. Examples for Zoho Creator's URL param: #Form:form1, #Report:report1 |
<optional_param> (Optional) | TEXT |
|
Example 1: Open a report of the same application form
Assuming a user submits a form called "My Contacts", you can use the following snippet in the On Success workflow action to take him to the form's report.
openUrl("#Report:My_Contacts_Report", "same window");
where:
"#Report:My_Contacts_Report"
"same window"
Example 2: Open a form of the same application in a popup window
The following example opens the form - Orders in a popup window of height - 510 px, width - 420 px, and sets the color - #34ebd2 as its background:
openUrl("#Form:Orders?zc_BgClr=#34ebd2","popup window","height=510px,width=420px");
where:
"#Form:Orders?zc_BgClr=#34ebd2"
Example 3: Open a form of a different application
The following example opens the form - registration from your application - customer-details:
openUrl("https://app.zohocreator.com/shawn24/customer-details#Form:Registration", "same window");
where:
"https://app.zohocreator.com/shawn24/customer-details#Form:Registration"
Example 4: Redirect to the previous URL loaded in the browser's history
The following script navigates to the previous URL loaded in the browser's location bar:
openUrl("#Script:page.back","same window");
Example 5: Use iframe on a Zoho Creator page
Let's say we have the following iframe snippet in a Creator page:
The following deluge script is written on the 'On User Input' workflows section. It opens the above mentioned iframe with different URLs depending on the selected product:
{
openUrl("https://www.zoho.com/creator", "iframe", "frameName");
}
else if (Product == "CRM")
{
openUrl("https://www.zoho.com/crm", "iframe", "frameName");
}