Questions tagged [cffunction]

is used in ColdFusion Markup Language (CFML) to create user defined functions.

<cffunction> is used in ColdFusion Markup Language to create user defined functions. The basic syntax is

<cffunction name="myFunc" returntype="string" output="false">

  <cfreturn "Hello, World!">
</cffunction>

Functions may be created as a global function or as apart of an object (cfc). Functions typically include business logic and not presentation logic.

Functions can also be defined in <cfscript> via

string function myFunc() output="false" {
   return "Hello, World!";
}

Resources

https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-tags/tags-f/cffunction.html

37 questions
0
votes
1 answer

Arguments in a coldfusion function

I've been told a cffunction should have no more than 3 arguments - Is there a better way to write this function? Every argument is a possible filter on the previous window and is used to filter the results down in the where clause.
0
votes
5 answers

Returning JSON in CFFunction and appending it to layer is causing an error

I'm using the qTip jQuery plugin to generate a dynamic tooltip. I'm getting an error in my JS, and I'm unsure if its source is the JSON or the JS. The tooltip calls the following function: (sorry about all this code, but it's necessary)
Mohamad
  • 34,731
  • 32
  • 140
  • 219
0
votes
1 answer

Coldfusion struct array error

I am trying to build the array to store the report column names, but I got the following error: You have attempted to dereference a scalar variable of type class coldfusion.runtime. Array as a structure with members. My code is:
tigerpuzzle
  • 69
  • 2
  • 8
0
votes
0 answers

how to pass the data of the function to a custom tag attribute

My Custom tag expects a “query” in one of the attribute but my cfc function returns me the structure when I dump it. This is my function listScores()