Показать сообщение отдельно
Старый 23.04.2009, 18:33   #7  
Dima_Dima is offline
Dima_Dima
Участник
 
144 / 11 (1) +
Регистрация: 09.10.2008
полдня битвы теперь с custAccount, вставляю в job все корректно, если в display, то во всех строках выдается первое значение. Делаю все вроде по лучшим рекомендациям. Такое ощущение, что значения достаются не с таблиц, а с кеша.
Где я косячу?

X++:
display AccountNum customerId()
{
    SMAserviceOrderTable        smaserviceordertableloc;
    SMAServiceOrderLine         smaserviceorderlineloc;
    Name                                _patID;
    ProjInvoiceEmpl                 projinvoiceemplloc;
    ;


    select CustAccount from smaserviceordertableloc
        exists join serviceOrderId from smaserviceorderlineloc
            where smaserviceordertableloc.serviceorderid        == smaserviceorderlineloc.ServiceOrderId &&
                     smaserviceordertableloc.AgreementId        == smaserviceorderlineloc.AgreementId
        exists join TransId    from projInvoiceEmplloc
            where projinvoiceemplloc.TransId                    == smaserviceorderlineloc.ProjTransId;

    _patID   = smaserviceordertableloc.CustAccount;

    return _patID;

}