Executes a named hook (record script) of this record's EntityDef Object.
You can use this method to execute a record script at runtime. Record scripts are routines you define and are specific to a particular record type. You can use record scripts in conjunction with form controls or you can call them from other hooks. You define record hooks using Rational® ClearQuest® Designer. The syntax for record scripts is as follows:
Function EntityDefName_RecordScriptName(param)
' param as Variant
' EntityDefName_RecordScriptName as Variant
' Hook program body
End Function
You cannot use this method to execute a field or action hook of a record. Neither can you execute a global hook, except indirectly from the record script.
You can call this method on an Entity object regardless of whether or not it is editable. However, if your script attempts to modify the Entity object, either your code or the hook code must first call EditEntity method to make the Entity object editable.
If your script accepts any parameters, put all of the parameters in a single Variant (for Visual Basic) and specify that Variant in param. The script must be able to interpret the parameters passed into it. Upon return, the script can similarly return a Variant with any appropriate return values.
For Perl, you can include multiple parameters by concatenating simple string values with a non-printing character as a separator (such as newline). This String can then be decoded with the built-in split operator.
VBScript
entity.FireNamedHook scriptName, param
Perl
$entity->FireNamedHook(scriptName, param);
VBScript
' Execute the hook "MyHook" with the specified parameters
Dim params(1)
params(0) = "option 1"
params(1) = "option 2"
returnValue = entity.FireNamedHook("MyHook", params)
Perl
# Execute the hook "MyHook" with the specified parameters
$params = "option 1\noption 2";
$returnValue = $entity->FireNamedHook("MyHook",$params);
# In the hook, split them like this:
my $param = shift;
my @params = split '\n', $param;