if seek(m.tiUserID,'c_Profiles','iUserID') local lnNumAccounts, lnQueue, lnAccountsToAssign, lnLowB, lnHighB * Find the maximum number of accounts to give to that user local array laMaxCount[1] select sum(nvl(iRegular_Account_limit,0) + ; nvl(iQueue_Overflow_count,0)) ; as nNumAccounts from c_Profiles where iUserID = m.tiUserID ; into array laMaxCount lnNumAccounts = laMaxCount[1] if m.lnNumAccounts > 0 select cur_QueueNames_From scan for (this.cDepartment_code = '%' or ; cDepartment_code = this.cDepartment_code) ; and empty(.cError) and not .lStopProcess store .f. to llRolesMismatch, llNeedToAssign store .t. to llGetAccounts, llProceed && Get accounts for each queue lnAlreadyScheduled = 0 select c_Profiles * browse liAllowedToAssign = c_Profiles.iAllowedToAssign * Let's assign for all roles for that user scan for iUserID = m.tiUserID ; and m.liAllowedToAssign > 0 and not lDontCheckAs you can see, I have commented browse in this code and, as I said, it works correctly if I uncomment this line. The c_Profiles.iAllowedToAssign becomes 0 for all records if I don't have browse. I can not figure out why this is happenning.
.GetUnAssignedAccounts(m.lnNumAccounts, m.tcUserID, ; m.lcQueue_Names_Fk, ; m.lnLowB, m.lnHighB, m.lcAdditionalFilter) lcNewQueue_Name = alltrim(c_Profiles.cQueue_Name) if reccount('curAccounts') = 0 .WriteToLogfile("There are no accounts " + ; "to assign to " + alltrim(m.tcUserID) + " for the role of " + ; alltrim(c_Profiles.cGrpDesc) + ; " for " + m.lcNewQueue_Name + " queue" + ; iif(not empty(m.lcAdditionalFilter), ; " because of the Employee " + ; "Queue Profile settings",""), .t.) replace lDontCheck with .t. in c_Profiles && so we would not run for other daysIn other words, if I determined what in the big pool of unassigned accounts there are no accounts satisfying profile of this particular user, I don't want to run the assign process for this User for other days. But for the rest of the users I want to continue with my normal logic. However, for some unknown reason this seems to affect all other users as well though AFAIK my replace should affect only one record.