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.

This functionality is available on the DevOps Plan application.

If the application supports this feature, the API will throw an exception, and any code after the API call is not executed. Use the callback hooks in the script to run additional code after the API call.

Note: For code samples illustrating how to open prepopulated forms, see Opening a prepopulated form.

Syntax

Perl


GSU_CQXE_SubmitRecord($session, $rcdType, $saveCallback, $cancelCallback, $fieldNameRef, $fieldValueRef)
Identifier
Description
$session
Current® DevOps Plan 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 DevOps Plan 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 form. The value must be the same length as $fieldNameArrayRef, otherwise the call returns an error string.

Example

Perl

sub Defect_SubmitChild {
    my($result);
    my($param) = @_;
    # record type name is Defect
    
    $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;
}