Script.GetDataTable(TableName).Count
.Count returns an integer with the number of rows in the table, grid, or query.
Applies To
- Event.Form.MainGrid.Results
- Event.Form.Parent.MainGrid.Results
- Event.Form.Parent.GetDataTable([TableName])
- Event.Form.Parent.Grids(FID).Results
- Event.Form.GetDataTable([TableName])
- Event.Form.Grids(FID).Results
- Inventory.LotExplosion(Lots[, View, EndDate, NegativeLots, ByProducts])
- Parameters.Results
- Query.GetTable(Query)
- Script.GetDataTable(TableName)
Properties and Methods
None
Available
The .Count property is available in:
- 15.03.016
- All newer builds
Type
Int32
Syntax
Script.GetDataTable(TableName).Count;
Parameters
None
Example
//--add this script to an event on the NewOrd1 form layout
var loTable = Script.GetDataTable('eTORD');
Event.Form.MessageBox(loTable.Count);
/* Expected Prompt Response:
1
Note: An edit data table will only have one row
If this were on a grid, it would be the number of rows in the grid
*/