Script.GetDataTable(TableName).AddBooleanColumn(Name)
.AddBooleanColumn(Name) adds a column to the data table or grid with the Name provided that will hold Boolean values. Deacom best practice recommends starting the name of these columns with 's_' to differentiate them from Deacom fields, user-defined fields, and calculated fields. This will indicate to users that the column is scripted.
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 .AddBooleanColumn(Name) method is available in:
- 15.03.016
- All newer builds
Type
Method
Syntax
Script.GetDataTable(TableName).AddBooleanColumn(Name);
Parameters
|
Parameter |
Required |
Description |
|---|---|---|
|
Name |
Yes |
A unique name used to identify this column. Deacom recommends starting these columns with 's_' to distinguish them from Deacom, User-defined, and calculated fields. |
Example
//--Add this script to an event on the NewOrd1 form layout
var loTable = Event.Form.MainGrid.Results;
loTable.AddBooleanColumn('s_Boolean');
/*
Deacom scripting adds a column called 's_Boolean' to the main grid on a form
When editing the grid layout, this column is now available to show in the grid
You will be able to add new true/false values to this column as needed
*/