Skip to main content
Inspiring
September 20, 2013
Question

FindNoCase

  • September 20, 2013
  • 1 reply
  • 658 views

Hi,

i want to find the if the record from the list is matched with the record from the query  but my code is not working.  Can you please help?

<cfset variables.subListItems = valuelist(variables.FindNocost.cost ,',') />

  <cfset variables.FindSubNoCost = report_Nocost.getSubNoCost() />

 

  <cfloop query="variables.FindSubNoCost">

   #listFindNoCase(variables.subListItems ,item, ",")#

  </cfloop>

Thanks

    This topic has been closed for replies.

    1 reply

    Inspiring
    September 21, 2013

    To my knowledge, lists don't have records, just indexes.  ie, in the following list "Alpha, Bravo, Charlie, Delta", each word is considered the index, which is separated by the delimeter (in this case, a comma).

    As for your first line, dump out VARIABLES.subListItems to ensure it generates the value you expect.  Also, for the valueList() BIF, you do not need to provide the delimeter if it is a comma (that is the default), you can just use:

    <cfset VARIABLES.subListItems = valueList( VARIABLES.FindNoCase.cost ) />  The VARIABLES.FindNoCost.cost variable needs to be a proper Query Column.  Try running an isQuery() BIF on the VARIABLES.FindNoCost variable.

    Also, do a dump on your VARIABLES.FindSubNoCost variable to ensure you have the expected records in it.  This dumping process is part of ensuring that you are not going under the assumption that the data is one thing, but it is in fact, not.

    Also, ensure you are in a <cfoutput> so that the YES/NO returned from listFindNoCase() is shown to you.  Also, you can remove the comma designator from the listFindNoCase() BIF as well.