Opening a prepopulated form with the GSU_CQXE_SubmitRecord API

Description

Use the GSU_CQXE_SubmitRecord global script utility to open a prepopulated form from a hook. This API provides the same functionality as the GSU_CQXE_OpenSubmitForm hook, but provides better performance because it does not create a temp object for the API which requires a database ID.

To use the GSU_CQXE_SubmitRecord global hook function, you must apply the GlobalScriptUtility (GSU_CQXE) package to update your schema with the global hook code. For instructions to download the global hook code, see Application de packages.

This functionality is available on the ClearQuest Client and the ClearQuest Web Client, Version 7.1.2 or later. If a user attempts to open a form from an older client, or from the ClearQuest client for Windows, the API returns an informational message. Pour afficher ce message pour l'utilisateur, appelez la fonction die.

Si le client prend en charge cette fonction, l'API fera une exception, et tout code après l'appel de l'API ne sera pas exécuté. Les points d'ancrage de rappel dans le script permettent d'exécuter du code supplémentaire après l'appel de l'API.

Remarque : For code samples illustrating how to open prepopulated forms, see Ouverture d'un formulaire prérempli.

Syntaxe

Perl

GSU_CQXE_SubmitRecord($session, $rcdType, $saveCallback, $cancelCallback, $fieldNameRef, $fieldValueRef)

Visual Basic

GSU_CQXE_SubmitRecord(session, rcdType, saveCallback, cancelCallback, fieldNameRef, fieldValueRef)

Identificateur
Description
$session
Current ClearQuest session.
$rcdType
The record type that you want to open.
$saveCallback
The record script attached to the original record. This script runs when the submit form is saved. If no callback is intended, specify an empty value ("").
$cancelCallback
The record script attached to the original record. This script is runs when the submit form is cancelled. If no callback is intended, specify an empty value ("").
$fieldNameRef
Reference to the array containing names of fields to be populated on ClearQuest form. Fields are set in the order that is given in this list. The order might be important for validation if there are dependent choice list fields.
$fieldValueRef:
Reference to the array containing values used to populate the ClearQuest form. The value must be the same length as $fieldNameArrayRef, otherwise the call returns an error string.

Perl example

sub Defect_SubmitChild {
    my($result);
    my($param) = @_;
    # le nom du type d'enregistrement est Défaut
    
    $session= $entity->GetSession();	
    my $id = $entity->GetFieldStringValue("id");   
    my $headline = $entity->GetFieldStringValue("Headline");

    my $fieldName = ["parent", "Headline"];
    my $fieldValue = [$id, $headline];
    $returnValue = GSU_CQXE_SubmitRecord($session, "Defect", "", "", $fieldName, $fieldValue);

    return $result;
}

Visual Basic example

Function Defect_SubmitChild(param)
 ' param As Variant
 ' le nom tu type d'enregistrement est Defect
   Dim session
   Dim id
   Dim headline
   Dim fieldName(2)'This sets up an array of three elements with subscripts from 0 to 1
   Dim fieldValue(2)'This sets up an array of three elements with subscripts from 0 to 1

   set session = GetSession 
   id = GetFieldStringValue("id")     
   headline =  GetFieldStringValue("Headline")

   fieldName(0) = "parent" 
   fieldName(1) = "Headline" 
   fieldValue(0) = id 
   fieldValue(1) = headline 
   call GSU_CQXE_SubmitRecord(session, "Defect", "","", fieldName, fieldValue)
    
End Function

Feedback