Script.GetDataTable(TableName).GetRow(X).GetInteger(Column)

.GetInteger(Column) returns the integer numeric value in the column specified for the DataRow object. This will return a numeric value.

Notes:

  • If you provide a column that is not a integer column, you will receive a scripting error. While you can technically get the integer value of a column upon adding a row, it is typically used with the GetRow(X) method.
  • Integer values like the Sales and Purchase Order numbers are too big for the integer data type and must be expressed as decimal numbers in scripting.
  • Using .GetInteger(Column) on a decimal column will truncate the decimal portion of the number.

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

None

Available

The .GetInteger(Column) method is available in:

  • 15.03.016
  • All newer builds

Type

Int32

Syntax

Script.GetDataTable(TableName).GetRow(X).GetInteger(Column);

Parameters

Parameter

Required

Description

Column

Yes

The column name in quotes that holds the integer value.

Example

//--add this script to a button on the edit Item Master layout

var loTable = Script.GetDataTable('ePROD');

var lrRow = loTable.GetRow(0);

var lnLevel = lrRow.GetInteger('pr_level');

var lcLevel = 'FG';

if(lnLevel !== 50)

{

lcLevel = 'not a FG';

}

Event.Form.MessageBox(`This item is a ${lcLevel}.`);

/*

This will provide a prompt with the following message for an item number if the pr_level = 50:

This item is a FG.

If the pr_level is 10, 20, 30, or 40 then the prompt will be:

This item is not a FG.

*/