Form Class

This object represents a Form instance. An instance is a completed Form, or one that is currently being edited.

When developing Form scripts (in the various callback methods such as BP_Event) or Timeline scripts, you are automatically given an instance of the “current” Form with the CurrentForm variable.

This object is derived from the ContentObject class. All properties and methods from the ContentObject are supported for this object, plus the properties below.

Properties #

PROPERTY NAME

DATA TYPE

DESCRIPTION

CloseOptions

Code Enum

This can be set in any form script. This property can be set to the following:

FormCloseOptions.CancelAndClose This will cancel the form when script returns.

FormCloseOptions.SaveAndClose This will save and close the form when script returns.

FormCloseOptions.NoneNo Action (default)

ControlFocus

Form Control Object

This property can be used to set the focus to a named control after the event returns. Set this property to null to prevent the focus from being set.

CurrentForm.ControlFocus = CurrentForm.FormControl("Text1");

CreateTime

DateTime

The date/time of this specific form instance’s creation

CreateUID

String

The User ID of the user which created this specific form instance

CustomOnLoad JavaScript Function Name

Enables you to specify a block of custom JavaScript to run in the OnLoad event of the Form.

For example, in an HTML Code control on the Form, you might specify the JavaScript to run, then set the CustomOnload property as follows in the Raw HTML property of the control:

<script>
function loadAlert ()
{
    alert("Hello, World!")
}

CustomOnLoad = loadAlert();
</script>

Note As always, when using JavaScript, ensure the HTML Code control's name is blank, to prevent Process Director from trying to interpret the curly brackets as a system variable.

In this example, the code above will display the alert box when the form loads.

DOCTYPE_HTML

Boolean

If set to true will use HTML rather than XHTML

DOCTYPE_HTML5

Boolean If set to true will use HTML rather than XHTML
FormCase Case Instance Object

Returns the Case instance associated with a Form instance, e.g.:

var currCase = CurrentForm.FormCase;

FORMID

String

The ID of the Form Definition for this instance

FORMINSTID

String

The optional ID of the Form instance

FormPartition

Partition Object

Set to the Partition object of the Forms partition

ID

String

The ID of this specific form instance

Name

String

The text name of this specific form instance

PID

String

The Partition ID of the partition where this form resides

ReturnNullsForErrors

Boolean

If set to true, APIs such as FormControl will return a null if the form control isn't found. Otherwise an empty class will be returned. The default is false.

SkipSetFocus Boolean Skips the set focus event.

UpdateTime

DateTime

The most recent date/time that a user changed this specific form instance

UpdateUID

String

The User ID of the user who most recently update this specific form instance

Methods #

Events #

There are six main types of events that are initiated when using Forms, each of which will be discussed separately below. Each of these event types contains a series of individual events that occur in a specific order, called the order of operations. Developers and implementers have access to the order of operations for each event type in two different ways: via scripting, or via the use of Custom Tasks.

When each event fires, scripted event procedures are implemented first, then Custom Tasks associated with the event are implemented. As a result, event scripts can set values or perform other operations that, when the script is complete, are available for the Custom Task to use when it is implemented.

Event Types