Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Very strange behavior
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Very strange behavior
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01141632
Message ID:
01141632
Vues:
52
Hi everybody,

I'm trying to figure out what's wrong with my queue assignment logic. Here is output when I try to assign for 20 days:
<snip>
As you can see, it looks like the process only attempts to assign accounts until it reaches
07/30/2006 12:54:57 PM Assigning accounts to SWILL001 for 07/31/2006
There are no accounts to assign to SWILL001 for the role of OUTPATIENT BILLER

Now, if I insert Browse to debug the problem, the problem doesn't occur.
Here is the piece of code
		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 lDontCheck
As 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.

I have this code later on:
.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 days
In 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.

Let me comment the replace command and re-run the process.
UPDATE. Commenting this line still give me the same problem.

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform