Public Script Functions
The PublicFunctions.js
file defines global functions and constant values for enumerated types for use in scripts.
Global Functions
Function | Description |
---|---|
CreateAttachmentsNameSizeEnum |
|
CreateBSTREnumFromArray |
Converts an array of strings into an enumeration object and returns the IGrooveBSTREnum object. This object can be used as an input parameter in some IGrooveFormsToolUIDelegate methods. This function can be called from macros as well as scripts. |
CreateUniqueID |
|
DisableField |
|
DoesFunctionExist |
|
EnableField |
|
GetApp |
|
GetAttachmentCount |
|
GetContactFieldValue |
|
GetFormID |
|
GetFormRecord |
|
GetHTMLFieldValue |
|
GetHTMLFieldValueAsDate |
|
GetHTMLFieldValueAsNumber |
|
GetIsFormPreview |
|
GetIsNew |
|
GetIsPreviewPane |
|
GetIsReadOnly |
Returns TRUE if the record is read-only -- that is the current user cannot update the record -- and FALSE otherwise. |
GetIsResponse |
|
GetIsSearch |
Returns TRUE if form opened in search dialog and FALSE otherwise. In macros, this function has no meaning. |
GetIsVersioned |
Returns TRUE if records are versioned for the current form; FALSE otherwise. If records are versioned for the current form, then when the user updates a record, the previous values are stored in a new record created as a child of the updated record. |
GetRecordID |
Returns the ID of the current record. |
GetSelectedID |
Returns the ID of the record selected in the view when the user is adding a record. If the record is a response, the selected record will be the parent of the newly created record. If the user is not adding a new record, this function returns -1. |
HasValidationErrors |
Returns TRUE if the last call to SaveCurrentFormData failed because there were validation errors, and returns FALSE if the last call to SaveCurrentFormData succeeded. |
HideField |
Hides a field. For compatibility with previous versions, this function takes an optional second parameter, i_bHide (which is not shown in the function syntax). If i_bHide is specified and has a FALSE value, this function is equivalent to |
InsertBSTREnumIntoListField |
Inserts string values from an IGrooveBSTREnum into a drop-down or listbox field. By default, it does not add a string value if it duplicates a value in the drop-down or listbox field. If you specify the optional parameter i_bAllowDuplicates as TRUE, the function skips the test for duplicates and adds all string values in the enumeration to the drop-down or listbox field. By using the results of a lookup as the i_BSTREnum value, you can easily add the results of a lookup to a drop-down or listbox field. |
IsValidDate |
Tests if a numeric value is a valid date field. The Forms tool stores date values as an integer in milliseconds from January 1, 1970. If the user leaves a date value unassigned, the Forms tool stores a large negative number in the record to indicate that the date value is unspecified. If you attempt to display this as a date value, you will get a meaningless date value. Consequently, you should test values read from date fields in records with this function before displaying the date or converting it to a text string. Returns TRUE if the date is valid; returns FALSE if the numeric value is the large negative number used to indicate unspecified dates. This function can be called from macros as well as scripts. |
LoadAddAttachmentDialog |
If the current form has an attachment field, this function displays the add attachment dialog to allow the user to select and add an attachment to the form. This function displays a modal dialog and should not be called from a script when a transaction is open. Note that macros are executed within an open transaction so this function should not be called from a macro. |
OpenThisRecord |
Opens the current record for edit in full-screen mode from the preview pane. Typically this function is executed from an |
RefreshErrorIcons |
Refreshes the location of error icons on the form. These error icons are displayed whenever the user enters data that does not pass validation. If a script dynamically relocates fields on a form, it should call this function to ensure that any error icons are displayed at the correct location. |
RefreshPreviewPane |
Refreshes the preview pane. Scripts should call this function when they are running on a form displayed in the preview pane and they have altered the contents of the form. The |
SetContactFieldValue |
Sets the specified form field to the specified contact. If the field has a type other than Contact, this function causes an error. If i_Contact has a null value, the existing contact is removed from the field. |
SetFieldLabel |
Sets the display label on the form to the string specified by the i_Label parameter. In macros there is no form; consequently, this function is not available. |
SetHTMLFieldValue |
Sets the value of any HTML field on the form to the specified string. It does not work on Rich Text or Attachments fields. You should not call this function on a field with a type of Date Time but should use SetHTMLFieldValueAsDate instead. Note that |
SetHTMLFieldValueAsDate |
Sets the value of a Date or Date Time HTML field on the form to the specified numeric date value. It only sets the value of the field if the field type is Date or Date Time. |
SetHTMLFieldValueAsNumber |
Sets the value of any numeric HTML field on the form to the specified numeric value. It only sets the value of the field if the field type is Number, Unformatted Number, or Currency. |
ShowField |
Displays a previously hidden field. This function takes an optional second parameter, i_bShow, which is not shown in the function syntax. If i_bShow is specified and has a FALSE value, this function is equivalent to |
Constants for Enumerated Types
Constant | Description |
---|---|
|
Specifies the icon to be displayed; used in the IGrooveFormsToolUIDelegateDisplayStatusBarMessage method. |
|
Values returned by the GrooveSimpleDialogResult property. |
|
Values returned by the GrooveFormsToolUIDelegateCurrentRole property. |
|
Date formats used by the GrooveFormsToolUIDelegateFormatDate, FormatDateTime, ParseDate, and ParseDateTime methods. |
|
Specifies the kind of link to create in the IGrooveFormsToolLinkObjectLinkType. |