Event.Form.Grids(FID)
Event.Form.Grids(FID) returns the form grid element object identified by the Functional ID (FID). The Grids elements are the grids on a form layout. The Event.Form.Grids(FID) allows the user to access the properties of the element like Enabled, Caption, and RecordNumber.
Note: Getting any form element object is an expensive scripting process. It is highly recommended that you only get a form element object once and store it in a local pointer object variable. Then use the pointer variable to get and set the various properties. See the example below.
Applies To
Properties and Methods
Properties
- .Array
- .Caption
- .Enabled
- .FunctionalIdentifier
- .GridCodeName
- .GridCopiedFromName
- .RecordNumber
- .Visible
Sub-Classes
- .Results
- .SelectedRow
Methods
- .Reload()
- .SelectGridRow(RowId)
- .SetFontColorFunction(FuncName)
- .SetRowColorFunction(FuncName)
Available
The .Grids(FID) method is available in:
- 15.03.016
- All newer builds
Note: The .Grids(FID) method and all sub-classes, properties, and methods are only available in Form Layout scripts.
Type
Grid
Syntax
Event.Form.Grids(FID);
Parameters
|
Parameter |
Required |
Description |
|---|---|---|
|
FID |
Yes |
The Functional Identifier of the input element. To find this, right-click on the caption of the grid you want to identify. The contextual menu will include a line for The Functional ID. |
Example
//--add this script to the change event of the Grid_contadd on the contadd form
var lpGrid = Event.Form.Grids('Grid_Contadd');
Event.Form.MessageBox('Grid: ' + lpGrid.FunctionalIdentifier +
'\nCaption: ' + String.Trim(lpGrid.Caption) +
'\nRecordNumber: ' + lpGrid.RecordNumber);
/* Expected Prompt response:
Grid: Grid_Contadd
Caption: Notes
RecordNumber: 3 // <--This value will change depending on which row you click on
*/