When discussing the “Basics of changecompany” we copied table records from one company to another through X++ code. Using buf2buf makes this is a lot easier.
Buf2buf is used to copy one recordbuffer to another:
buf2buf(Common _from, Common _to) |
If we apply this to the code we used in “Basics of changecompany” we get:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | static void FO_changecompany(Args _args) { FO_TestTable table, table2; ; while select table { changecompany("FO1") { table2 = null; ttsbegin; buf2buf(table, table2); table2.insert(); ttscommit; } } } |
Last 5 posts in Development
- No valid document identified from the entity key - April 9th, 2010
- Using Regular Expressions in Dynamics AX - October 2nd, 2009
- Create class and methods in x++ - December 22nd, 2008
- Simple field lookup in form - October 13th, 2008
- Get your Intercompany CustAccount - September 29th, 2008