Submitted by Armando on 2009/07/12 19:35
If the "item" field text contains a string which is identical to another field name,
it will prevent VB functions from working properly if they're using that field as a parameter.
 
(Possibly, the bug could involve any String from any text field, and not just the item field, of course. Haven't tested that though.)
 
I can reproduce that easily. [ EDIT : but only with the example below...! ]
 
 
Seems to be a problem with my own code. But can't find where the problem lies...
 
Code example used for item color calculation (important lines at the end of function):

Function CalcColor
(Urgency, Item, xMO, itemColor, Solution)   ' calculation of the itemcolor color code based on the Urgency level
 
  if isnull(Urgency) then
     CalcColor = ""
  else
    if Urgency < -10 then
     CalcColor=""
    elseif Urgency <=-3 then CalcColor="&H1AF3FF"
    elseif Urgency < 0 then CalcColor="&H1AB5FF"
    elseif Urgency <=5 then CalcColor="&H1A70FF"
    else CalcColor="&H1A1AFF"
    end if
  end if


  elseif xMO <> 0 then
    CalcColor="Moss"
 
  elseif solution <> 0 then
    CalcColor="Powder"



  end if
 
 end if

End Function



If necessary : steps to reproduce the problem

1- Copy the provided code in User code (to replace the original IQ  CalcColor function)

2- Copy this equation in the itemcolor field equation textbox :
 
=CalcColor(Urgency, Item, xMO, itemColor, Solution)

3- a) Create two YES/NO fields : one called xmo, and one called Solution.
 
     b) and add this to condition format rule to the xMO one :
 
A:itemcolor="moss" | E:itemcolor=
 
(note that "moss" must correspond to some color code in IQ's options)

4- open a grid and create an item including the string "solution"  (eg : "trouver solution pour...") in the "item" field.

5- the itemcolor field won't get the appropriate color and will stay blank : the "solution" word in the item text either conflicts with the VB function integrating values from the "solution" field, or something else....
 
 
I can reproduce that even if the function parameter "solution" (that refers to the "solution" field) is given another name (like "soln" or whatever).

Comments

Not sure if that's that reproduceable with any fields though. The bug happens only with the "Solution" String, for some reasons. I'll have another check at the VB code, but it's weird and I don't understand what's happening...

Armando

2009/07/13 22:21

In reply to by Armando

It seems to be a problem with my script... only I can't find it. :(