Search code examples
axaptax++dynamics-ax-2009

Update_recordset, anything faster?


I'm trying to refrain from doing a mass update directly through SQL and want to use X++ jobs to do it, but what I want to do is pretty darn slow.

I've got about 3500+ customer records (CustTable) to update, here's what I have:

static void fixCustLanguageId(Args _args)
{
    CustTable custTable;
    ;

    ttsbegin;

    try {

        update_recordset custTable
        setting
            LanguageId = 'fr'
        where custTable.AccountNum like 'LML*' && custTable.LanguageId == 'fr-ca';
        ttscommit;
        info('Done updating customers');
    }
    catch
    {
        ttsabort;
        error('Error updating customers');
    }


}

This is taking many hours to complete, is this normal ? Any way to achieve this faster ?

Thanks


Solution

  • I ended up a while select forupdate since my case ended up involving much more logic than what I initially posted. Thanks anyways.