Источник:
http://dynamicsaxhints.blogspot.com/...pdate-job.html
==============
I want to challenge you today to find an error in the following update job. Do not pay attention on the functional part. I agree, the job can be rewritten, but let's assume it must be done this way.
static void crossCompanyUpdate(Args _args)
{
CustTable custTable;
CustGroup custGroup;
PaymTermId oldPaymTermId =
'Net10', newPaymTermId =
'Net11';
ttsBegin;
// find all companies with oldPaymTermId
while select crossCompany custGroup
group by custGroup.dataAreaId
where custGroup.PaymTermId == oldPaymTermId
{
changeCompany(custGroup.dataAreaId)
{
// disable update method
custTable.skipDataMethods(
true);
// set newPaymTermId
update_recordSet crossCompany custTable
setting PaymTermId = newPaymTermId
where custTable.PaymTermId == oldPaymTermId;
}
}
ttsCommit;
}
Post your ideas into comments. I will open comments and post my solution in one week. Have fun :-)
Источник:
http://dynamicsaxhints.blogspot.com/...pdate-job.html