>external procedure GetEmployeesQueuesInfo >do case >case m.tcField = 'cuserid' > =GetAllUserLinks('c_AllUsersWithLinks') > =GetEmployeesQueuesInfo(this.dEnteredDate, 'c_Count1') > > select cUserId, sum(iAccounts_count) as iAccounts_count, ; > sum(yBalance) as yBalance ; > from c_Count1 ; > INNER join c_AllUsersWithLinks ; > on c_Count1.cUsGrLink_pk = c_AllUsersWithLinks.cUsGrLink_pk ; > into cursor c_count readwrite ; > group by 1 > index on cUserId tag cUserId > use in c_Count1 && not used anymore > >case m.tcField = "cusgrlink_pk" > =GetEmployeesQueuesInfo(this.dEnteredDate, 'c_Count') >endcase>