Need to update the list of users on my form

book

Article ID: 141444

calendar_today

Updated On:

Products

CA Harvest Software Change Manager CA Harvest Software Change Manager - OpenMake Meister

Issue/Introduction

I have a form in Harvest that contains a list of userids in one of the fields.  Some of these userids are for people no longer here and they need to be removed.  How can we do this?

Environment

Release : 13.0

Component : CA HARVEST SCM CORE FUNCTIONALITY/PROCESS AUTOMATION

Resolution

A little “Harvest Forms 101” will help.

In Harvest, forms are used to collect information. You can have different types of forms, depending on the type of information you want to collect. For example you could have one type of form to collect names and addresses for a phone list, and another type of form to collect information about a defect that was found in a software program. With Harvest you can have as many different “types” of forms as you need. You can easily see what types are available in the Administrator Tool on the Forms tab:

In our case we want to make an update to the format of a certain type of form in your Harvest database. The easy way to tell what is the “form type” you want to update is to look at the tab at the bottom of one of the forms in Workbench.

There are 4 different files that Harvest creates to make up the form type’s definition. They all have the name of the form type as the file name, and different file extensions (.hfd, .sql, .xml, and .htm). After the form has been created and installed, the primary one we need to change anything on the form is its XML file. Quite often, these files get lost as time goes by, but the good news is the xml file gets imported into the Harvest database, so it’s not gone forever. I’ve got a script that will let us extract out the form type’s xml file that I’ll upload to the ftp folder for our case. To run it, copy this file to the broker machine, any folder will do. Then execute the SQL script, providing the name of the form type you want to extract – something like this:

sqlplus [email protected]/password @ExportFormXML.sql "Form Type Name"

In the resulting report, what you find between the “*** Start of script ***” and “*** End of script ***” lines is the contents of the xml file. You will take everything between (but not including) “*** Start of script ***” and “*** End of script ***” and copy it to a new, empty text file. Name the file with the name of the form type and a ".xml" file extension, and save it to the following folder:
(on Windows): “C:\ProgramData\CA\SCM\Forms”
(on Linux) “/opt/CA/scm/Forms”

You can create and edit this SQL script from the broker machine, or on a Windows computer that has the SCM Administrator Tool installed.

Now, every place in the xml script where you see a line beginning with “<combobox…” describes a dropdown list box on your form. The “label=” parameter tells you which combobox it is.

Starting the next line after the “<combobox…” line is the list of all the values that should be displayed in the combobox. The value between “>” and “<” is the value to be displayed, and the line that says “” indicates the end of the list. For example:

<combobox cols="8" dbfield="mydropdown" id="mydropdown" label="My Dropdown Listbox" maxsize="15" rows="1">
  <entry dbfield="listitem1">mydropdown</entry>
  <entry dbfield="listitem2">mydropdown</entry>
  <entry dbfield="listitem3">mydropdown</entry>

  <entry dbfield="listitem99">mydropdown</entry>
</combobox>

The easiest way to change the contents of the list box is to edit this xml file with Notepad, or your favorite text editor, then use the “hformsync” command to import it back into the database.
- To remove an item from the list, delete that line in the xml file
- To add an item, duplicate one of the “<entry…” lines in in the list and change the value between ‘>” and “<” to be the value you want to add.

When the the combobox list has been updated to reflect only the values you want to see, save and close the file then use the hformsync command, to import it back into the Harvest database. Like this:

hformsync -b brokername -prompt "Service Request.xml"

And always check the log file after running the command to ensure it succeeded:

(on Windows) type hformsync.log
(on Linux) cat hformsync.log

Here’s where you can read more about the hformsync command:
https:$$techdocs.broadcom.com$content$broadcom$techdocs$us$en$ca-enterprise-software$business-management$harvest-scm$13-0$command-reference$get-started-with-ca-harvest-scm-commands$hformsync-command-update-form-template.html

Additional Information

Attached are the SQL scripts that will extract the XML for a form type from the Harvest database

Attachments

1575909523351__ExportFormXML_sqlserver_windows.sql get_app
1575909513219__ExportFormXML_oracle_windows.sql get_app
1575909501137__ExportFormXML_oracle_linux.sql get_app