IBM Support

How to set the field requiredness properties of a field based on the ClearQuest client

Troubleshooting


Problem

This technote explains IBM® Rational® ClearQuest®This technote explains how to set the field requiredness properties of a field based on the IBM® Rational® ClearQuest® client being used.

Resolving The Problem

It is possible to set the field requiredness properties dynamically through the use of hook code in ClearQuest. The following steps summarize how this can be done using Visual Basic hook code:.

  1. Open ClearQuest Designer and open the schema to be modified.
  2. Drill down to Actions and select the cell under Initialization for the Submit action name. Change it to a BASIC script.
  3. Insert the following code in the script under the last REM statement and before End Sub. In this code example the Priority field is being set to MANDATORY (Priority form label appears in red) in a client session and OPTIONAL in the web session for the Defect record type.


  4. Dim MySession
    Dim CheckWebSession

    Set MySession = GetSession
    CheckWebSession = Mysession.NameValue("_CQ_WEB_SESSION")

    If CheckWebSession = FALSE then
    'FieldRequirdness is set MANDATORY if initiating source
    is not the web client
    SetFieldRequirednessForCurrentAction "Priority", AD_MANDATORY
    Else
    'Fieldrequiredness is set OPTIONAL if initiating source
    is the web client
    SetFieldRequirednessForCurrentAction "Priority", AD_OPTIONAL
    End if

  5. Save changes, validate, check in the schema and update the user database.

In this example, a single field was used, but multiple fields can easily be added in the same script where their field requiredness is determined in the same manner.

Note:
All records submitted by the E-mail Reader will be viewed as a client session.



[{"Product":{"code":"SSSH5A","label":"Rational ClearQuest"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Designer - Fields and Lists","Platform":[{"code":"PF033","label":"Windows"}],"Version":"7.0;2003.06.16;2003.06.15;2003.06.14;2003.06.13;2003.06.12;2003.06.00;2002.05.20;2002.05.00;7.0.1;7.0.0.2","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Historical Number

114395760

Document Information

Modified date:
16 June 2018

UID

swg21120039