AX 2012: crossCompany delete_from

Posted on Updated on

Although we cannot use crossCompany keyword with delete_from command, we can still achieve the same functionality with some performance overhead as follows:

static void JobCCDel( Args _args )
{
    Table21 tab21a, tab21b;

    ttsBegin;
    while select crossCompany minof(ratingNum), dataAreaId from tab21a
        group by dataAreaId
    {
        changeCompany(tab21a.dataAreaId)
        {
            tab21b = null;
            delete_from tab21b
                where tab21b.ratingNum == tab21a.ratingNum;
        }
    }
    ttsCommit;
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s