Table = Table versus table. Table (table)

What is the difference between the two instructions below?

newTable = orginalTable 

or

 newTable.data(originalTable) 

I suspect this is useful for the .data () method, as it is more commonly used in standard AX.

+6
source share
1 answer

Try the following:

 newTable = originalTable; info(strfmt('%1 %2', newTable.recId, originalTable.recId); newTable.data(originalTable); newTable.insert(); info(strfmt('%1 %2', newTable.recId, originalTable.recId); 

You will see that the first statement simply creates another pointer to an existing record. The second creates a new copy of the existing record.

+9
source

Source: https://habr.com/ru/post/920868/


All Articles