How to make a specific field mandatory

Document ID : KB000092777
Last Modified Date : 13/09/2018
Show Technical Document Details
Introduction:
I would like to make a certain field on the forms for my Harvest packages mandatory.  How can this be done?
Environment:
CA Harvest SCM versions 12.0 and up
All platforms
Instructions:
To make a field mandatory on a Harvest form type we will need to:
  1. Determine which type of form has the field that should be mandatory, and where the definition files for this form type are kept.
KB article KB000077109 explains how to do this.  Need the link.
  1. Edit the form type’s XML file to add ‘ required=”true” ‘ to the line defining the field in the xml file.
In this example, I want to make the “Category” field on the “Defect Tracking” form type mandatory.  After locating my “Defect Tracking.xml” file, and opening it for edit, I find that the “Category” field is described on line 27.  On this line I changed from:
 
<combobox cols="11" dbfield="dtcategory" id="dtcategory" label="Category" maxsize="11" rows="1">

To:
<combobox cols="11" dbfield="dtcategory" id="dtcategory" label="Category" maxsize="11" rows="1" required=”true”>
  1. Use the hformsync command to import the form type’s updated xml file to the Harvest database.
To import this back into the Harvest database you need to copy this updated file to the broker machine or to a Harvest Client machine that has the command line utilities or Administrator Tool and then run the hformsync command.
  • On the broker machine or a client machine with Administrator Tool and/or the command line utilities installed open a command prompt window.
 
  • CD to the folder where the SCM Form description files are stored.  
On a Windows machine the folder will be:
 
cd C:\ProgramData\CA\SCM\Forms

On a Linux or Unix machine the folder will be:
 
cd $CA_SCM_HOME/Forms
 
(you should be logged in as the owner of the SCM folders and bkrd process so that the $CA_SCM_HOME environment variable has been set)
 
  • Execute the hformsync command to import the updated “Defect Tracking.xml” file to the Harvest database:
 
hformsync -b brokername -usr userid -pw password -f "Defect Tracking.xml"
 
Please change:
brokername = the name of your Harvest broker
userid = the userid of a Harvest administrator
password = the password of a Harvest administrator
 
  • It is always good to check the hformsync command’s log file to assure that the result was successful.  
 
On a Windows machine execute:
 
type hformsync.log

On a Linux/Unix machine execute:
 
more hformsync.log

On a Windows machine the result would look like this:
User-added image 

After successfully importing the form type xml file, the change will take effect immediately.  No need to restart the broker.  To complete the example, now, any time a user tries to save a Defect Tracking form, they will get an error message if the Category field has not been completed:
 User-added image