Script.GetDataTable(TableName).AddRow([IDColumn])

.AddRow([IDColumn]) adds a row to the data table or grid. The default action will add an ID to the column identified by Deacom as the ID column. You can also provide the column to use as the ID column with the optional parameter.

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

Methods

  • .CopyFrom(From)
  • .GetBoolean(Column)
  • .GetDateTime(Column)
  • .GetDecimal(Column)
  • .GetInteger(Column)
  • .GetString(Column)
  • .SetBoolean(Column, Val)
  • .SetDateTime(Column, Val)
  • .SetDecimal(Column, Val)
  • .SetInteger(Column, Val)
  • .SetString(Column, Val)

Available

The .AddRow([IDColumn]) method is available in:

  • 15.03.016
  • All newer builds

Type

DataRow

Syntax

Script.GetDataTable(TableName).AddRow([IDColumn]);

Parameters

Parameter

Required

Description

IDColumn

No

The name of a column within the data table or grid. IDColumn name is in quotes.

Example

//--add this script to an event on the NewOrd1 form layout

var loTable = Event.Form.MainGrid.Results;

loTable.AddRow();

//--Or

loTable.AddRow('to_id');

 

/*

Deacom scripting adds a row to the main grid on a form

Typically, the Deacom supplied ID Column is sufficient to what is required

When editing the grid layout, any data you add to the row will appear in the grid

*/