Script.GetDataTable(TableName).GetRow(X).CopyFrom(From)
.CopyFrom(From) allows the user to copy the data from one row and add it to another row within the same cursor, table, or grid. The From parameter is a DataRow object easily gathered by using the .GetRow(X) method which returns a DataRow Object.
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 .CopyFrom(From) method is available in:
- 15.03.090
- 15.04.059
- 15.05.034
- 16.00.039
- 16.01.014
- 16.02.004
- All newer builds
Type
Method
Syntax
Script.GetDataTable(TableName).GetRow(X).CopyFrom(From);
Parameters
|
Parameter |
Required |
Description |
|---|---|---|
|
From |
Yes |
A data row object representing the row to copy to a new row in the cursor, table, or grid |
Example
/--add this script to an event on the NewOrd1 form layout
var loTable = Event.Form.MainGrid.Results;
var lrRow = loTable.GetRow(0);
loTable.AddRow().CopyFrom(lrRow);
/*
Deacom scripting adds a row to the main grid on a form and copies the data from the first row into this row
The variable lrRow holds the DataRow object with the columns and values present in Row 0 (The first row of the grid)
The last line adds a new row to the grid and copies the values from the first row into this row's columns
*/