Opening a URL
The GSU_CQXE_OpenURL global hook opens
a web browser window to a specified URL. The function first opens
a confirmation dialog, whose message you can customize. If the user
clicks OK in the dialog, the browser opens;
if the user clicks Cancel, the dialog closes
and focus returns to the record form.
This functionality is available on the DevOps Plan application.
To
use the
GSU_CQXE_OpenURL global hook function to
open a URL, you must apply the GlobalScriptUtility
(GSU_CQXE) package to update your schema with the
global hook code. - In the Designer, right-click on the version of the schema where you want to apply the package and select . The Package Wizard opens.
- Expand the GlobalScriptUtility node in the list of packages and select version 1.0. Click Next.
- Select the record types where you want to apply the package. Click Finish.
GSU_CQXE global
script in the schema.For more information about applying packages, see Packages.
Example
The following examples show a record script that you can use with the global hooks to open a URL. In these examples, clicking an OpenHCL button opens a dialog and asks whether the user wants to open a browser to the specified URL.
To use this example, make the following
changes to your schema:
- Create a record script named
Open_Url, using the Perl example. - Add a new tab named
OpenURLto the Defect_Base form in the Defect record type. - On the OpenURL tab, add a new Button control named
OpenHCL, and associate it with theOpen_Urlrecord script.
Perl
sub Defect_Open_Url {
my($result);
my($param) = @_;
# record type name is Defect
$url="http://www.hcl.com";
$msg="Do you want to open a browser to this URL?";
my $session = $entity->GetSession();
GSU_CQXE_OpenURL($session,$url,$msg);
return $result;
}