Script.GetDataTable(TableName).AddDateTimeColumn(Name)
.AddDateTimeColumn(Name) adds a column to the data table or grid with the Name provided that will hold DateTime 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 .AddDateTimeColumn(Name) method is available in:
- 15.03.016
- All newer builds
Type
Method
Syntax
Script.GetDataTable(TableName).AddDateTimeColumn(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.AddDateTimeColumn('s_Today');
/*
Deacom scripting adds a column called 's_Today' 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 DateTime values to this column as needed
*/