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

.GetString(Column) returns the character value in the column specified for the DataRow object.

Notes:

  • If you provide a column that is not a decimal column, you will receive a scripting error. While you can technically get the string value of a column upon adding a row, it is typically used with the GetRow(X) method.
  • Using GetString(Column) on a non-character column may return the value in the column, but the value will be a string. As an example, using .GetString() on a Boolean field will return 'true' a string, not true the Boolean value.

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 .GetString(Column) method is available in:

  • 15.03.016
  • All newer builds

Type

String

Syntax

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

Parameters

Parameter

Required

Description

Column

Yes

The column name in quotes that holds the string 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 lcDescrip = String.Trim(lrRow.GetString('pr_descrip'));

Event.Form.MessageBox(`The description for this item is: '${lcDescrip}'`);

 

/*

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

The description for this item is: 'Corrugated Cardboard Box 12" x 12" X 8"'

*/