Script.GetDataTable(TableName).GetRow(X).GetDateTime(Column)
.GetDateTime(Column) returns the DateTime object in the column specified for the DataRow object. To get a value from this DateTime object, you must use one of the properties below
Notes:
- If you provide a column that is not a DateTime column, you will receive a scripting error.
- While you can technically get the DateTime object of a column upon adding a row, it is typically used with the GetRow(X) method.
Applies To
- Event.Form.MainGrid.Results.AddRow([IDColumn])
- Event.Form.MainGrid.Results.GetRow(X)
- Event.Form.MainGrid.SelectedRow
- Event.Form.Parent.MainGrid.Results.AddRow([IDColumn])
- Event.Form.Parent.MainGrid.Results.GetRow(X)
- Event.Form.Parent.MainGrid.SelectedRow
- Event.Form.Parent.GetDataTable([TableName]).AddRow([IDColumn])
- Event.Form.Parent.GetDataTable([TableName]).GetRow(X)
- Event.Form.Parent.Grids(FID).Results.AddRow([IDColumn])
- Event.Form.Parent.Grids(FID).Results.GetRow(X)
- Event.Form.Parent.Grids(FID).SelectedRow
- Event.Form.GetDataTable([TableName]).AddRow([IDColumn])
- Event.Form.GetDataTable([TableName]).GetRow(X)
- Event.Form.Grids(FID).Results.AddRow([IDColumn])
- Event.Form.Grids(FID).Results.GetRow(X)
- Event.Form.Grids(FID).SelectedRow
- Inventory.LotExplosion(Lots[, View, EndDate, NegativeLots, ByProducts]).AddRow([IDColumn])
- Inventory.LotExplosion(Lots[, View, EndDate, NegativeLots, ByProducts]).GetRow(X)
- Parameters.Results.AddRow([IDColumn])
- Parameters.Results.GetRow(X)
- Query.GetTable(Query).AddRow([IDColumn])
- Query.GetTable(Query).GetRow(X)
- Script.GetDataTable(TableName).AddRow([IDColumn])
- Script.GetDataTable(TableName).GetRow(X)
Properties and Methods
Properties
- .Day
- .DaylightSavings
- .DayOfWeek
- .DayOfYear
- .Hour
- .ISOString
- .LongDateString
- .LongTimeString
- .Minute
- .Month
- .Second
- .ShortDateString
- .ShortTimeString
- .Year
Methods
- .AddDays(Days)
- .AddHours(Hours)
- .AddMinutes(Minutes)
- .AddMonths(Months)
- .AddSeconds(Seconds)
- .AddYears(Years)
- .Compare(To)
- .Copy()
- .StringDayOfWeek([Culture])
- .StringMonth([Culture])
Available
The .GetDateTime(Column) method is available in:
- 15.03.016
- All newer builds
Type
DateTime
Syntax
Script.GetDataTable(TableName).GetRow(X).GetDateTime(Column);
Parameters
|
Parameter |
Required |
Description |
|---|---|---|
|
Column |
Yes |
The column name in quotes that holds the DateTime value. |
Example
//--add this script to a button on the edit Sales Order layout
var loTable = Script.GetDataTable('eTORD');
var lrRow = loTable.GetRow(0);
var ldOrder = lrRow.GetDateTime('to_orddate');
Event.Form.MessageBox(`The sales order was ordered on: ${ldOrder.ShortDateString}`);
/*
This will provide a prompt with the following message for an item number:
The sales order was ordered on: 4/12/2023
*/