What is the difference between the two statements below?
newTable = orginalTable
or
newTable.data(originalTable)
I suspect there is a performance benefit to the .data() method as it is more commonly used in standard AX.
A data table is a range of cells in which you can change values in some of the cells and come up with different answers to a problem. A good example of a data table employs the PMT function with different loan amounts and interest rates to calculate the affordable amount on a home mortgage loan.
Data tables are used in Excel to display a range of outputs given a range of different inputs. They are commonly used in financial modeling and analysis to assess a range of different possibilities for a company, given uncertainty about what will happen in the future.
What is Data Table in Excel? A Data Table in Excel helps study the different outputs obtained by changing one or two inputs of a formula. A data table does not allow changing more than two inputs of a formula. However, these two inputs can have as many possible values (to be experimented) as one wants.
A DataTable object represents tabular data as an in-memory, tabular cache of rows, columns, and constraints. The DataSet consists of a collection of DataTable objects that you can relate to each other with DataRelation objects.
Try this:
newTable = originalTable;
info(strfmt('%1 %2', newTable.recId, originalTable.recId);
newTable.data(originalTable);
newTable.insert();
info(strfmt('%1 %2', newTable.recId, originalTable.recId);
You'll see that the first statement just creates another one pointer to existing record. The second one creates new copy of existing record.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With