Показать сообщение отдельно
Старый 23.07.2007, 17:36   #9  
kashperuk is offline
kashperuk
Участник
Аватар для kashperuk
MCBMSS
Соотечественники
Сотрудники Microsoft Dynamics
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
Лучший по профессии 2011
Лучший по профессии 2009
 
4,361 / 2084 (78) +++++++++
Регистрация: 30.05.2004
Адрес: Atlanta, GA, USA
Цитата:
Сообщение от PavelSR Посмотреть сообщение
Я подозреваю, что для этих целей придется заводить отдельное поле во временной(результирующей) таблице.
Быть может есть возможность, всетаки, обойтись без добавления доп. поля?
Возможность, конечно, есть.
Стоит ли ей пользоваться?

X++:
static void Job30(Args _args)
{
    CustTrans   custTrans;
    custTrans   tmpcustTrans;
    ;
    tmpcustTrans.setTmp();
    changecompany('S11')
    {
        custTrans = null;
        select firstonly custTrans;
        buf2buf(custTrans, tmpcustTrans);
        tmpcustTrans.overwriteSystemfields(true);
        tmpcustTrans.(fieldNum(CustTrans, DataAreaId)) = curExt();
        tmpcustTrans.doInsert();
    }
    while select tmpcustTrans
    {
        info(tmpcustTrans.dataareaid);
    }


    changecompany('S10')
    {
        custTrans = null;
        select firstonly custTrans;
        buf2buf(custTrans, tmpcustTrans);
        tmpcustTrans.overwriteSystemfields(true);
        tmpcustTrans.(fieldNum(CustTrans, DataAreaId)) = curExt();
        tmpcustTrans.doInsert();
    }

    while select tmpcustTrans
    {
        info(tmpcustTrans.dataareaid);
    }
}