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

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

Note: If you provide a column that is not a decimal column, you will receive a scripting error. While you can technically get the decimal 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.

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

  • 15.03.016
  • All newer builds

Type

Decimal

Syntax

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

Parameters

Parameter

Required

Description

Column

Yes

The column name in quotes that holds the decimal 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 lnTotal = lrRow.GetDecimal('to_totdue');

Event.Form.MessageBox(`The total due on this sales order is: $${lnTotal}`);

 

/*

This will provide a prompt with the following message for an item number:

The total due on this sales order is: $435.23

*/