Duplicating names

Im using the below code which is basically letting me assign calls to a list of people. once you click on either “name1”, “name2”, or “name3” the call will be assigned to that person
this bit is working fine, only when for example the call is assigned to “name2”, it will now display “name2” three times on the fourm
one time for each person that you have on the assign list
is there a way this can be changed, so once you assing a call to “name2” it will only display it once


<cfif staffvalue neq "-">#staffvalue#<cfelse><a href="index.cfm?LOGTRACKER_Key=#LOGTRACKER_Key#&action=assign" title="Assign">Assign to name1</a></cfif>

<cfif staffvalue neq "-">#staffvalue#<cfelse><a href="index.cfm?LOGTRACKER_Key=#LOGTRACKER_Key#&action=assign1" title="Assign1">Assign to name2</a></cfif></td>

if I understand you right, you’re looping through calls and on each row a cell is created with either a list of names to choose from (current staffvalue EQ “-”) or a single name of a person that has been chosen (current staffvalue NEQ “-”).

But after a person is selected for the call, you’re still getting a complete list of available people?


Hi downtroden

Thats exactly my problem, sorry for not making it more clear

I believe your problem is you have multiple if statements. You code is actually working the way it’s being told to work.

Here’s what you’re wanting to happen

<cfif staffvalue neq "-">
     <cfloop list/query="#available_people#" index="person">
          <li><a href="index.cfm?LOGTRACKER_Key=#available.people.LOGTRACKER_Key#&action=assign" title="Assign">Assign to #available_people.name#</a></li>

Obviously you would have to create a new object that contains all your available people that can be assigned tasks. list/query is to show that you can use either.

Hope this helps/solves your problem

Hi downtroden

sorry with the delay in replying,
I tried the above and created a new query but im getting this error
“Complex object types cannot be converted to simple values
The most likely cause of the error is that you are trying to use a complex value as a simple one. For example, you might be trying to use a query variable in a cfif tag.”

you have to pick list OR query in your cfloop tag. Sorry, I put both trying to show that it could be a list or a query. If you choose query, you don’t need the index attribute.

Thanks for your help on this one downtroden

works perfect now