The open url deluge task when executed takes the user to the specified url.
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.
Examples
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": The TEXT that represents the Zoho Creator URL. It opens the report with link name - My_Contacts_Report from the same application the task is executed.
"same window": The TEXT that represents the URL needs to be opened in the same 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": The TEXT that represents the Zoho Creator URL. It opens the form with link name - Orders from the same application the task is executed. The zc_BgClr is a styling attribute that fills the background of the form with the specified color.
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": The TEXT that represents the form URL
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:
- <iframe name="frameName" width="1000" height="1000" frameborder="0" scrolling="yes"> </iframe>
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:
- if (Product=="Creator")
- {
- openUrl("https://www.zoho.com/creator", "iframe", "frameName");
- }
- else if (Product == "CRM")
- {
- openUrl("https://www.zoho.com/crm", "iframe", "frameName");
- }