We help IT Professionals succeed at work.

ColdFusion Language





ColdFusion is a server-side rapid application development platform originally created by Allaire and now sold by Adobe, implementing the dynamic general purpose CFML programming language. The term ColdFusion is sometimes colloquially used to refer to the CFML language (Cold Fusion Markup Language), but can also include discussions of the server software implementation. ColdFusion runs using a customised version of Apache Tomcat. Earlier versions are bundled with JRun.

Tried to install ColdFusion 11 on Server 2016.  The installer finished sucessfully, but when trying to open the CFadmin page, I get error 404.   Looking in IIS manager, it doesn't look like the installer created the default website like it usually does...what do I do?
I'm doing an ajax call to a ColdFusion function to return a query. It should return a single record with three columns for an event's title, description, and date. I want to place each of those three pieces in their corresponding divs. Everything is working fine but I can't figure out how to access the results, and the options I've Googled up have failed me. How do I get the JSON equivalent of CF's queryName.columnName? Thanks!

The jQuery I'm using is as follows:
		 var id = this.id;
		 var splitid = id.split('_');
		 var eventID = splitid[1];
		 // AJAX request
			type: "POST",
			url: "/cfc/calendar.cfc?method=getEventAjax",
		  dataType: "json",
			data: {
			 returnFormat: "json",
			 eventID: eventID
			success: function(response){ 
				// Add response in Modal body
				$('#eventTitle').html(what goes here for the title?);
				$('#eventDescription').html(what goes here for the description?);
				$('#eventDate').html(what goes here for the date, and what about formatting?);
				// Display Modal
			error: function (response) {
        $("#modal-body").html("This event could not be loaded.");

Open in new window

The function is simple:
<cffunction name="getEventAjax" access="remote" returntype="query" hint="returns info for single event">
		<cfargument name="eventID" type="numeric" required="yes">
		<cfquery name="qGetEvent" datasource="#APPLICATION.ds#">
			SELECT eventTitle, eventDescription, eventDate FROM calendar
			WHERE ID = <cfqueryparam value="#ARGUMENTS.eventID#" cfsqltype="CF_SQL_INTEGER">
		<cfreturn qGetEvent>

Open in new window

In the console log I'm getting
{COLUMNS(3), DATA: Array(1)},
DATA: Array(1)
0: Array(3)
0: "Radio Interview with Lucy Ann Lance of 1290AM"
1: "<p>Interview will take place at 8:20am EST</p>"
2: "July, 29 2019 00:00:00"
I have a PDF template. And I am using Coldfusion and database to get the data. Now i need to take that data and populate the PDF.  the data size is different so sometimes it is 1 page and sometimes 1+.

My template is only 1 page. How can I use the same template to say add another page
I'm trying to figure out how to access query data in a ColdFusion function. I have a query (qMyQuery) that's been returned from another function that will look something like this:

   | year   |  data
1  |  2014  |  1234
2  | 2015  |  2345
3  |  2016  |  3454

Open in new window

I'm sending it to a function that will figure out if the latest number is an increase or decrease and set the variables myQueryClass and myQueryDirectionText accordingly. This is what I'm sending:

<cfinvoke component="cfc.helpers" 
		variablePrefix = "myQuery"

Open in new window

And here is the function:
	<cffunction name="setCSS" access="public" returntype="array">
		<cfargument name="forQuery" type="string" required="yes" hint="the name of the query for which to set the css">
		<cfargument name="queryData" type="query" required="yes" hint="the query content">
		<cfargument name="upIsGood" type="boolean" required="yes" default="TRUE" hint="is an increase a good thing">
		<cfargument name="variablePrefix" type="string" required="yes" hint="what to preface the class/txt variables with">
		<cfargument name="directionTextUp" type="string" required="yes" default="Increasing" hint="the text for an increase in data">
		<cfargument name="directionTextDown" type="string" required="yes" default="Decreasing" hint="the text for an decrease in data">

Open in new window

Formatting SQL

i had this code

<cfset _top = 'USE [#ucase(dsn)#]#chr(13)#BEGIN TRY#chr(13)##chr(9)#BEGIN TRAN#chr(13)#'>
         <cfset _bottom = '#chr(9)#COMMIT TRAN#chr(13)#END TRY#chr(13)#BEGIN CATCH#chr(13)##chr(9)#ROLLBACK TRAN#chr(13)##chr(9)#SELECT Error_number ()    AS ErrorNumber,#chr(13)##chr(9)#Error_severity ()  AS ErrorSeverity,#chr(13)##chr(9)#Error_state ()     AS ErrorState,#chr(13)# #chr(9)#Error_procedure () AS ErrorProcedure,#chr(13)##chr(9)#Error_line ()      AS ErrorLine,#chr(13)##chr(9)#Error_message ()   AS ErrorMessage;#chr(13)#END CATCH#chr(13)##chr(13)##chr(10)#/*#chr(13)##chr(10)#Description: Create DML for  #table# table#chr(13)##chr(10)#Created by: me #chr(13)##chr(10)#Created: #dateformat(now(),'mm/dd/yyyy')##chr(13)##chr(10)#Last changed: #dateformat(now(),'mm/dd/yyyy')##chr(13)##chr(10)#*/'>     <cfset insertFINAL = '#_top##chr(13)##trim(createUpdateStatement)##chr(13)##_bottom#'>

Open in new window

the problem is thi is not display properly in the window as a very good formatted way, everything is coming in a single line

please guide what can be fixed here


if you ask for createUpdateStatement - this is just an update statement coming from a table which just written within the cfoutput tags , no chr being used for this
I am trying to place charts in tooltips using google charts. And got stock . Placing charts in the tooltip from this page


I am using this example but but instead of showing linear graph I need to to show a bar graph. The original graph is the linear graph

Thank you

	google.charts.load('current', {'packages':['corechart']});
	var primaryData = [
		<cfoutput query="qGetClassesPerMonth">
			["#sYearFull#", '#sessionKey#']	,
      var tooltipData = [
        <cfoutput query="qGetClassesPerMonthPerToolTip">
        	['#sessionkey#','#zipcode#','#zCnt#']	,
        var tooltipOptions = {
        title: 'U.S. Viewership Over The Last 10 Years (in millions)',
        legend: 'none'
      function drawTooltipCharts() {

        var data = new google.visualization.arrayToDataTable(tooltipData);
        var view = new google.visualization.DataView(data);

        // For each row of primary data, draw a chart of its tooltip data.
        for (var i = 0; i < primaryData.length; i++) {

          // Set the view for each event's data
          view.setColumns([0, i+1]);

          var hiddenDiv = 

Open in new window

I have a search cfm form that passes user inputs to another form. Call it test.cfm. It takes the inputs and passes to cfc to return a query results. works fine. problem is I have a create excel button that is supposed to open excel with the results. It opens but with no results. this is done on the posting of the same test.cfm form so looks like I lose my form variables from the search file. So how do I either save those values when posting same page or store the query results? Session variable? not sure how to do that.
Trying to learn ColdFusion.
I have a search page for user input that opens another page for viewing. That Page (call it test.cfm), is supposed to display the query results and display a button to export to excel. IF I use an cfinvoke to a component where I run the query and return it works. But trying to do that portion with an include to a javascript page using ajax and json to return the query. But never done this before and can't figure it out. Does anyone have a example how to do this?
I've attached my cfm and cfc page. I stripped out code to make it more simple to review. didn't include the javascript page because it's all wrong.
Good Morning Dear Expert,

I'm actually using Cfswitch expression to play several module on the same page with a page's "refreshment" when i submit the form.. i would like to use Coldfusion and Ajax for a different experience.. Is it possible on a input or submit Click, to call an Ajax function on the same page and in this function, change the variable of the CFcase expression to play a different mudule ?

Any response will be helpful..
Can a query result in ColdFusion be exported to a docx file? I see examples using cfspreadsheet to export to excel but not for word. Ideally I would open a word template and select a bookmark and export results to that location.

Anyone have an example?

I'm new to ColdFusion so trying to learn what I can do. Using ColdFusion 2016 with ColdFusion Builder.
Dear experts,

I have an input Text that get a javascript value but when i try to get it with coldfusion, i have an error; Coldfusion cannot convert this form value to a number..

Here i get the javascript value:

<input type="text" class="control" id="imgplace" >

Open in new window

But i cannot use it in this coldfusion fonction:

<cfset ImagePaste(imgc, area, 0, #form.imgplace#)>

Open in new window

is there a way to get this form value in coldfusion ?
I have a website written using Coldfusion. It is a dynamic website getting its content from a MySQL database

I am evaluating some tools that require connecting via an API. The type recommended is OUAUTH2 but other types are supported as well. I have never done anything like this before. Can anyone provide any information regarding how I would create an OUAUTH2 API.

Thank you for any help that you can provide
We are consuming some data from one of our vendors that gets returned in XML.  Some of the nodes have a dash ("-") in it - member-list.  I am just trying to loop through the results to update a table

<cfloop from="1" to="#arraylen(mydoc.member-list.membership.XmlChildren)#" index="i" step="1">

Open in new window

but coldfusion doesn't like the dash.  I have tried mydoc.["member-list"].membership.XmlChildren but that doesn't work either.We are running CF2016.
What is required so that a Youtube video will play on a website page? I have a website and on one page the Youtube video plays fine but on another page the same video does not play.

On the page that works when I hover over the play button it turns from black to red.

On the page the doesn't work the play button doesn't change its appearance when I hover over it.

When I press play on the page that doesn't work nothing happens.

My website is built using Coldfusion
error code ... according to the tutorial everything is correct I can't find the error (https://coldfusion.adobe.com/2017/11/bulk-inserting-data/) ... can anyone help first time using cold fusion
The <cfloop> tag requires an end tag to nest within <cfquery>, which began on line 12, column 2.
The CFML compiler was processing:

The body of a cfquery tag beginning on line 12, column 2.
The body of a cfquery tag beginning on line 12, column 2.
The error occurred in D:/home/semsreports.net/wwwroot/GPS_Action_page.cfm: line 17
15 :  values gps_id,unit_assigned,event,date,crew_one,crew_two
16 : 
17 : <cfloop from="1" to="#arraylen(users)#" index="u"> 
18 :  <cfif u NEQ 1>,</cfif>
19 :  (

Open in new window

Action page
<cfset gps_id = FORM["GPS_ID[]"]>
<cfset  unit_assigned = FORM["Unit_assigned[]"]>
<cfset event = FORM["event[]"]>
<cfset date = FORM["Date[]"]>
<cfset gps_id = FORM["GPS_ID[]"]>
<cfset crew_one = FORM["crew_one[]"]>
<cfset crew_two = FORM["crew_two[]"]>
<cfset comments = FORM["comments[]"]>

<cfquery datasource="xxxxxx " name="insert_gps_data">
 insert into gpstable  (GPS_ID,Unit_asssign, event, Date, crew_one,crew_two)
 values gps_id,unit_assigned,event,date,crew_one,crew_two

<cfloop from="1" to="#arraylen(users)#" index="u"> 
 <cfif u NEQ 1>,</cfif>
 <cfqueryparam cfsqltype="cf_sql_varchar" value="#insert_gps_data[u].GPS_ID#">,
 <cfqueryparam cfsqltype="cf_sql_varchar" value="#insert_gps_data[u].Unit_assigned#">,
 <cfqueryparam cfsqltype="cf_sql_varchar" value="#insert_gps_data[u].event#">,
 <cfqueryparam cfsqltype="cf_sql_varchar" value="#insert_gps_data[u].Date#">,
 <cfqueryparam cfsqltype="cf_sql_varchar" value="#insert_gps_data[u].crew_one#">,
 <cfqueryparam cfsqltype="cf_sql_varchar" value="#insert_gps_data[u].crew_twot#">

Open in new window

var ct = 1;
function new_link()
	var div1 = document.createElement('div');
	div1.id = ct;
	// link to delete extended form elements
	var delLink = '<div style="text-align:right;margin-right:65px"><a href="javascript:delIt('+ ct +')">Del</a></div>';
	div1.innerHTML = document.getElementById('newauth').innerHTML + delLink;
// function to delete the newly added set of elements
function delIt(eleId)
	d = document;
	var ele = d.getElementById(eleId);
	var parentEle = d.getElementById('newlink');

   #newlink {width:600px}
<form method="post" action="Action_page.cfm">
<div id="newlink">
<table border=0>
		<td> GPS ID: </td>
			<input type="text" name="GPS_ID[]" value="" validate='YES'>GPS ID <font size = -1 color = red>Required</font> 
			<input type="Text" name="Unit_assigned[]" value="noauth" validate="YES">Unit Assigned<font size = -1 color = red>Required</font> 
			<input type="text" name="event[]" value=<cfoutput>#form.Event_Name#</cfoutput> validate="YES">Event<font size = -1 color = red>Required</font>  
			<input type="Text" name="Date[]" value=<cfoutput>#form.Date#></cfoutput><font size = -1 color = red>Required</font> 
			<input type="text" name="event[]" value="" validate="YES">Crew Member 1<font size = -1 color = red>Required</font> 
			<input type="text" 

Open in new window

I have converted my query into the stored procedure. The stored procedure executes a lot slower than the query itself. I am using sql server 2008 R2. In sql management studio it takes about 4 sec to return 4 records in the code it takes 15 seconds
/****** Object:  StoredProcedure [dbo].[sp_GetCancellations]     ******/
ALTER PROCEDURE [dbo].[sp_GetCancellations] AS

SELECT S.sessionKey,
				        L.Name AS LocationName,
				        U2.FirstName as insFirstName,
				        U2.LastName as insLastName,
				            SELECT COUNT(1)
				            FROM sessionMap SM
				            WHERE S.sessionKey = SM.sessionKey
				                AND SM.userKey != 0
				        (CONVERT(int, CONVERT(varchar, SU.sessionStart, 112)) - CONVERT(int, CONVERT(varchar, U.dateOfBirth, 112)))/10000 as searcherAge
				    FROM session S
				        INNER JOIN sessionUnit SU  ON S.sessionKey = SU.sessionKey
				        INNER JOIN product P  ON P.productKey = S.productKey AND P.productTypeKey IN (2,4)
				        INNER JOIN lkup_availState LS  ON S.officeStateKey = LS.availStateKey
				        INNER JOIN sessionMap SMP 

Open in new window

One of our clients recently switched to Cloudflare for their DNS management.  We have debugging turned on our dev environment for them for specific ip addresses.  But now with Cloudflare, the server no longer knows our IP address.  We aren't using Enterprise Cloudflare.  Any ways around this mess?
Upgrading Apache Tomcat on a Coldfusion 10 server.  Our company recently revived a security notification about a possible vulnerability. The vulnerability is called CVE-2019-0232 . The recommendation is to upgrade from our current Tomcat to Tomcat version 7.0.94

Does anybody know if doing a manual upgrade is possible on Coldfusion 10 on Windows? Or is it best to wait for Adobe to release a patch? I'm skeptical that Adobe will do much about this anytime soon.
On my development PC running Coldfusion 2016 I succesfully created a program which uses JSOUP.

When exporting the .CFM to be "live machine" which runs Coldfuison2018 I get the below message
Object Instantiation Exception.
Class not found: org.jsoup.Jsoup

Further research on my development PC revealed there are two JSOUP Jar file in C:\ColdFusion11\cfusion\wwwroot\WEB-INF\lib

I copied the below JAR to my production machine but I am still getting the message
Object Instantiation Exception.
Class not found: org.jsoup.Jsoup

Any help is greatly appreciated
I need to call Coldfusion CFC from the PHP on the different server
Have to upgrade windows server (Windows server 2008 standard) and ColdFusion 9  to higher versions of Windows and CF.  
Any inputs?  Long time since I played with CF.  Want something that will not break the existing CF Pages

we are using ColdFusion 9 standard.
Using CFMAIL, but the spool folder will keep growing because it sends mail only every 3 seconds. and it need to send around 5000 mail every 15 minutes.

our exchange is working properly .
any recommendation to solve this issue  .
Good day everyone....I have a problem with an Oracle (SQL) query and Coldfusion. I'm basically trying to query an Oracle database from multiple tables and build a new table. With that new table I want a sequential number in the ID field, starting at 1 and I want to start off slow to verify my data as I add more fields. So I have a simple piece of code below that does a count on my main table, and then I can add the data (count) to my ew table:

<cfquery name="getArt" datasource="PDBDEV">
    SELECT COUNT(*) AS numItems

<cfloop from="1" to="#getArt.numItems#" index="i">

<cfquery name="qrySubmitForm" datasource="PDBDEV">

But now, I want to add a field from the same table...and that fails so I believe I'm missing something. If I add the PROJ_NO field from the BUDGET_MIPRS_SENT table, it makes me add a grouping. And then if I add a group to the query, all I get is one record when I should get about 2000.

<cfquery name="getArt" datasource="PDBDEV">
    SELECT COUNT(*) AS numItems,

So I'm guessing its not as simple as adding data fields?? Any guidance would be greatly appreciated.
I have a site that conducts encryption/decryption of data, with the process being guided by a specified encryption key that is included in the application.cfm file. However, since they updated the server to CF 11, I have started consistently getting the following error

An error occurred while trying to encrypt or decrypt your input string: The input and output encodings are not same..
The error occurred in D:/home/rilsintake.org/wwwroot/left_side_nav.cfm: line 35
33 : <cfoutput>
34 : <cfloop query="all_calls_in_unit" startrow="#url.startrow#" endrow="#endrow#">
35 :       <li><a href="callback.cfm?intakeid=#intakeid#"> #Decrypt(URLDecode(all_calls_in_unit.CLIENT_LASTNAME), "#enc_key#")#, #client_firstname#</a> -<cfif all_calls_in_unit.court_date is not "">
36 :         <font color="##FF0000">#DateFormat(call_intakedate, 'mm/dd/yy')#</font>
37 :             <cfif all_calls_in_unit.interpreter is 'Y'><br><font color='0000ff'><strong>Interpreter Needed</strong></font></cfif>

Any suggestions will be helpful.

ColdFusion Language





ColdFusion is a server-side rapid application development platform originally created by Allaire and now sold by Adobe, implementing the dynamic general purpose CFML programming language. The term ColdFusion is sometimes colloquially used to refer to the CFML language (Cold Fusion Markup Language), but can also include discussions of the server software implementation. ColdFusion runs using a customised version of Apache Tomcat. Earlier versions are bundled with JRun.

Top Experts In
ColdFusion Language