Axapta X++ buf2Buf copy record ,Copying table records to duplicate table
static void buf2Buf_Example(Args _args)
{
//Updating by buf2Buf()
SourceA source,
destination;
;
source.number = 1;
source.fieldA = 'xxx';
source.fieldB = 'yyy';
source.fieldC = 'zzz';
destination = sourceA::find(1,true);
ttsBegin;
buf2Buf(source, destination);
if (!destination.validateWrite())
throw Exception::Error;
destination.update();
ttsCommit;
info('done');
}
{
//Updating by buf2Buf()
SourceA source,
destination;
;
source.number = 1;
source.fieldA = 'xxx';
source.fieldB = 'yyy';
source.fieldC = 'zzz';
destination = sourceA::find(1,true);
ttsBegin;
buf2Buf(source, destination);
if (!destination.validateWrite())
throw Exception::Error;
destination.update();
ttsCommit;
info('done');
}
ความคิดเห็น
แสดงความคิดเห็น