Of the types of objects available to be placed on a SCM form, the "button" object is not available. How can we add a button to a form?
Harvest Software Change Manager v12.x and higher
Create your custom form type normally, using the instructions found in the Harvest documentation here: Create and Modify Form Types
Once the xml file for your form has been created, you can edit the xml file and
<button id="button1" label = "button1"/>
<events language="javascript" client="eclipse">
function button1Clicked(){
var file1 = editor.getTextFieldValue("hodproject");
var app1 = "notepad.exe";
java.lang.Runtime.getRuntime().exec(app1 + " " + file1);
}
</events>
Here is an example form's xml file:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE harvest_form SYSTEM "harwebForms.dtd">
<harvest_form dbtable="buttontest" id="buttontest" name="Testing A Button" numtabs="0">
<events language="javascript" client="eclipse">
function button1Clicked(){
var file1 = "C:\\Temp\\README.TXT";
var app1 = "notepad.exe";
java.lang.Runtime.getRuntime().exec(app1 + " " + file1);}
</events>
<text-field cols="80" dbfield="formname" id="formname" label="Form Name" maxsize="128"/>
<text bold="false" italics="false" size="5" value="This form tests a button"/>
<button id="button1" label = "button1"/>
</harvest_form>
Once your form's xml is updated, use the hformsync command to upload it to the Harvest database. Once this is successfully completed, when you open your form, you will now see a button: