Go Premium for a chance to win a PS4. Enter to Win

x

ColdFusion Language

10K

Solutions

3K

Contributors

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.

Share tech news, updates, or what's on your mind.

Sign up to Post

CFGRID runs into JSON Parse error while fetching data. However, sometimes 20K records come back in the grid while at other times, the error would display for 700 records.
0
[Webinar] Cloud and Mobile-First Strategy
LVL 11
[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

In a.cfm I have:
<CFSET VerObj = New cfcomponents.VerFold.Ver_Users()>
<CFSET VerObj.Functiion_1(userid)>

In the next few template, c.cfm, I need to call a different function within Ver_Users.cfc I can do the same thing:
<CFSET VerObj = New cfcomponents.VerFold.Ver_Users()>
<CFSET VerObj.Function_2(userid)>

If I need to call the same cfc again from yet another template down the road and I keep doing this I think it is very awkward and repetitive? the purpose of using .cfc is so that I can reuse or call the functions by just doing:

<CFSET VerObj,Function_1()> or
<CFSET VerObj,Function_2()>

from anywhere without keep instantiating the cfc, am I correct? is there any example on how I can accomplish This?
0
I am trying to send text message througth Coldfusion to a people phones and I am suing cfmail tag,. The text is going fine. The question is Is there a way to send a text message as a notification so it stays on the phone as a notofication . Without person needed to go to their messages and check for incoming messages
0
Has anyone implemented SAML 2 using Coldfusion?

We would be the service provider and the identity provider for a single sign-on (SSO).

Seeking any sample code, CFC or anything to help jump start the project!

Thanks
0
Just taking a survey of other developers for best practices in maintaining your search filters and order-by while paging through multiple pages of search results.

Typical scenario.. user enters a few search filters and presses search.   Say, 500 results and showing 25 records per page.  The user changes the display order and clicks through to page 2, page 3, etc.  

What approach are people using to maintain the where-clause (search filters) and the order by so that each page, the same results are shown, but a different page.

Store SQL where clause in session variable?
Save filter criteria to the database?
Save search results to a temporary table and page through them?
Put search fields and order-by fields inside the search form and resubmit them each time?

Pros and cons for all approaches.
Just curious to change/improve my method.
0
My form has checkboxes with user roles, and a select box with users. I need a select box to repopulate based on the checkbox value(s) when clicked. The checkboxes allow selection of either "all" (in which case the select options need not change) OR any combination of "cm", "adv", "cd" values. Once the checkbox(es) get clicked, the select box should repopulate dynamically (all this before form gets submitted).

<cfquery datasource="datasourceName" name="qry_staff">
    SELECT userID, lastname + ', ' + firstname AS staffName
    FROM   userTable
    WHERE  role IN('cm','adv','cd')
    </cfquery>

<form>
<input type="checkbox" name="assignedRole" id="checkedAll" value="all">All<BR>
<input type="checkbox" name="assignedRole" id="assignedRole" value="cm" class="checkSingle">Case managers<BR>
<input type="checkbox" name="assignedRole" id="assignedRole" value="adv" class="checkSingle">Advisors<BR>
<input type="checkbox" name="assignedRole" id="assignedRole" value="cd" class="checkSingle">Career developers

<select name="staff>
<cfloop query="qry_staff" multiple="multiple">
<cfoutput>
<option value="#qry_staff.userID#">#qry_staff.staffName#</option>
</cfoutput>
</cfloop>
</select>
<input type="submit">
</form>

The entire page must not reload every time a user changes text box selection(s). I haven't yet been able to find a suitable solution. I'm jquery knowledgeable, but not so much Ajax. What I've been able to find makes me think Ajax would really be the way…
0
I've wrapped each argument using val() per an earlier suggestion. This is eliminating the value cannot be converted to a number error but now the data isn't being pulled. Just an empty return.

I changed this:
<cfset countttl = #invcounts.15Count# + #invcounts.1530C# + #invcounts.30plusC#>

Open in new window



to this:

<cfset countttl = val(invcounts.15Count) + val(invcounts.1530C) + val(invcounts.30plusC)>
<cfset dollarttl = val(invcounts.less15days) + val(invcounts.15to30Days) + val(invcounts.30plusDays)>

Open in new window


I'm using a cfc file and one of the queries returning no data is:

<cfquery name="invCounts" datasource="#dsn#"  >
select /*+ NO_USE_HASH(T,F) */ sum(CASE WHEN P.ACCOUNTING_DATE between i.terms_date and i.terms_date + 15 THEN i.invoice_amount 
                                        ELSE 0 END) "less15days", 
       sum(CASE WHEN P.ACCOUNTING_DATE between i.terms_date and i.terms_date + 15 THEN 1 
                ELSE 0 END) "15Count", 
       sum(CASE WHEN P.ACCOUNTING_DATE between i.terms_date + 16 and nvl(F.NEW_DUE_DATE, F.ORG_DUE_DATE) THEN i.invoice_amount 
                ELSE 0 END) "15to30days", 
       sum(CASE WHEN P.ACCOUNTING_DATE between i.terms_date + 16 and nvl(F.NEW_DUE_DATE, F.ORG_DUE_DATE) THEN 1 
                ELSE 0 END) "1530C", 
       sum(CASE WHEN P.ACCOUNTING_DATE > nvl(F.NEW_DUE_DATE, F.ORG_DUE_DATE) THEN i.invoice_amount 
                ELSE 0 END) "30plusdays", 
       sum(CASE WHEN P.accounting_date > 

Open in new window

0
I thought I had fixed the situation w/ the "The value " cannot be converted to a number." However its still showing up. I set up the parameter:

<cfparam name="form.period" default="0">

Open in new window


And the form field as below:

                    <tr>
                      <td class="maintxt12_bold"><span class="style9">Accounting Period:</span></td>
                      <td colspan="3" class="maintxt12_bold">
                       <input type="text" 
                      	 		name="period" 
                      	 		validate="regex"
                      	 		style="text-transform:uppercase"	 	                  	 		
                      	 		pattern="^(JAN|FEB|MAR|APR|JUN|JUL|AUG|SEP|OCT|NOV|DEC)-(19|20)[0-9]{2}$" 
                      	 		message="The value cannot be converted to a number." 
                      	 		required="true"
                      	 		id="period"
                       			class="Headline12DrkBlu" 
                       			size="10" 
                       			maxlength="8"
                       			default="#period#">                     
                        &nbsp;<span class="Arial_Red12Bold">* MON-YYYY</span></td>
                    </tr>

Open in new window


when I pull the style="text-transform:uppercase"             everything works but if I leave that and pull the regex it breaks.

Does anyone see where I may be setting this up wrong?
0
can you run cold fusion in a docker contianer , I dont know if you can even do this , have you done this or have and example that you know works ?

thanks
0
The following script is producing invoices.  It was working fine in 4.5, but my server has upgraded to CF 7.0.  The first invoice is produced, and then I encounter the error,  I have removed all addresses from the database except for the 20 or so valid ones from people who bid in the auction.  I am not a CF expert, and I am freaking out a little bit.

Here is the code:

<html>

<head>
<title>SEND INVOICES</title>
</head>

<body BGCOLOR="#FFFFFF">

<CFIF ParameterExists(ID) IS "NO"><CFSET ID=0></CFIF>
<CFIF ParameterExists(PASS) IS "NO"><CFSET PASS=0></CFIF>
<CFQUERY name="validate" DATASOURCE="DJS">SELECT * FROM ADMIN WHERE ID='#ID#' AND PASS='#PASS#'</CFQUERY>
<CFIF VALIDATE.RECORDCOUNT is 0><CFLOCATION URL="ERROR.CFM?ERROR=2"></CFIF>

<CFQUERY name="checkclose" datasource="DJS">select * from times where type='auction'</cfquery>
<CFIF #checkclose.enddate# LT #CreateODBCDateTIME(now())#>
<CFQUERY NAME="AUCTIONINFO" DATASOURCE="DJS" MAXROWS="1">SELECT * FROM TIMES</CFQUERY>

<CFQUERY NAME="lots" DATASOURCE="DJS">SELECT * FROM lots ORDER BY lot ASC</CFQUERY>

<CFLOOP QUERY="lots">

<CFQUERY name="highbidder" datasource="DJS" maxrows="1">SELECT * FROM bids WHERE lot = #lot# ORDER BY bid DESC</CFQUERY>

<CFIF HIGHBIDDER.RECORDCOUNT IS NOT 0>

<CFQUERY NAME="HBI" DATASOURCE="DJS" MAXROWS="1">SELECT * FROM MEMBERS WHERE MEMBERID='#HIGHBIDDER.MEMBERID#'</CFQUERY>

<CFQUERY NAME="CHECKTABLE" DATASOURCE="DJS" MAXROWS="1">SELECT * FROM WINTABLE WHERE …
0
Free Tool: IP Lookup
LVL 11
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Hi,
I currently use a cfdiv to bind to a data file (data.cfm).
This data.cfm file simply creates a CFquery and a html Table..

When I use ColdFusion.Navigate I can refresh the above div (called div1) easily.

However I have changed m CfDiv into a std html div and I am trying to use the $ajax.load function to reload the div.

I believe my calling code is correct.

 $('#div1').load('data.cfm?id=100');

However it seems jquery just ignores the server side code in my data.cfm file.
If I makes a blank data.cfm with a few lines of html the do refresh ok.

But not my data.cfm with what I need.
cfquery and cfoutput & table.

Any help would be appreciated..
0
I'm looking for help getting a jump start on implementing SAML 2.0.   I have read a lot of documentation but it all seems geared towards the user-end, not the developer end.   Here is our situation.

We provide a website to corporate clients, each corporation has many users.   These companies have their own websites and their users have their own logins.   Our clients want their users to login to their website and be able to pass through to our website without needing a login on our website.

-Our clients' websites would login the user  and then pass the user onto our site without needing to login
-Our site would accept the user as long as the client says they are valid, we are ok accepting them.  
-We would create a corresponding user record on our end for each user

What do we need to do on our end to implement SAML?  
Can we code something and/or do we need a third party?
We code in Coldfusion (CF 11)

While I do understand Single Sign-On and the parts of SAML needed.  I have yet to find steps to actually implement.  Any help with this would be greatly appreciated.
0
I'm trying to integrate a coldfusion app with MS sharepoint. Both sites are within the intranet so it shouldn't be anything network related. I'm able to browse to the wsdl file from a browser but the cfsharepoint tag part gives following error:

Unable to read WSDL from URL: https://nri.pcd.com/books/authors/_vti_bin/Lists.asmx?wsdl.

***********************************************************************************
Here's my cf code snippet:
***********************************************************************************
<cfscript>
      login = {domain="https://nri.pcd.com",
      username="uname", password="pwd"};
</cfscript>

<cfoutput>
      
            <cfsharepoint action="getlistcollection"
                  wsdl="https://nri.pcd.com/books/authors/_vti_bin/Lists.asmx?wsdl"
                  login="#login#"      name="result">
</cfoutput>

<cfdump var="#result#">
0
<cfoutput>
<cftry>
	<cfhttp url="https://rest.bandsintown.com/artists/spencerkane/events?app_id=day6mgmt&start_date=2017-01-01" result="httpResult" charset="utf-8" method="get"/>
 	<cfset BITdata = deserializeJSON(httpResult.filecontent)/>
	<cfloop array="#BITdata#" index="post">
		<cfif StructKeyExists(post, "datetime")>
			<cfset event_date = post.datetime>
		<cfelse>
			<cfset event_date = "">
		</cfif>
		<cfif StructKeyExists(post, "venue.name")>
		    <cfset ev_title = post.venue.name>
		<cfelse>
            <cfset ev_title = "">
		</cfif>
		<cfif StructKeyExists(post, "venue.city")>
			<cfset city = post.venue.city>
		<cfelse>
			<cfset city = "">
		</cfif>
		<cfif StructKeyExists(post, "venue.region")>
			<cfset region = post.venue.region>
		<cfelse>
			<cfset region = "">
		</cfif>
		<cfif StructKeyExists(post, "offers.url")>
		<cfset tickets = post.offers.url>
			<cfelse>
		<cfset tickets = "">
			</cfif>

<!--- FEED OUTPUT --->        
<cfif not event_date is "">		
#event_date#<p>
#ev_title#<p>
#city#<p>
#region#<p>
#tickets#
<hr />
</cfif>		
	</cfloop>

	<cfcatch type="any">
		<p>
			<cfdump var="#cfcatch#" />
			#LSDateFormat(Now(), "dd-mm-yyyy")# #lsTimeFormat(Now(), "HH:mm")#<br />
			<a href="##">
				Oh, sorry... I can't connect to Bandsintown
			</a>
		</p>
	</cfcatch>

</cftry>
</cfoutput>

Open in new window


My output only gives me the datetime and none of the other structure data even though the raw feed in a browser window definitely shows there is more data to be displayed. I am using Adobe's output structure of data.struct1.substruct but it doesn't display anything.
0
I have a JSON feed which dumps a Facebook Page timeline feed. For some reason, Facebook allows a linked URL to be part of the actual message that is sent via JSON. So if I had a FB post that included a link to a Youtube video, it comes through the JSON feed like

'check out my cool new video http://www.youtube.com/myvideoid'

I'd prefer to strip out the url string from the JSON result and have it just give me

'check out my cool new video'

I know this has something to do with ReFindNoCase() or another similar thing, but I don't know how to write the code to strip it out and just leave me the message without the long url string.
0
Currently we are migrating from coldfusion 6 to coldfusion 2016.

<cfloop index="RSG004_i" from="1" to="#RSG004_dt.num#" step="1">

I want you to tell me how to deal with this error.
Thank you.
0
Hi,

Am using ColdFusion version 8,

Am export my Db recordset datas using,

<cfsavecontent variable="report">XXXXX</cfsavecontent>

<cffile action="write"  file = "#fullfile#" output="#report#" nameconflict="overwrite">

It's export fine,but I need to expand excel column width.Please Refer my attachment , I got my excel output like my attachment.file:///tmp/mozilla_geetha2/Employee_Report-3.xls
0
Hi, Here is the code i am trying to convert PHP code in ColdFusion code

Here is the code i have
public static function calculateSignature($consumerId, $privateKey, $requestUrl, $requestMethod, $timestamp=null)
    {
        if(is_null($timestamp) || !is_numeric($timestamp)){
            $timestamp = self::getMilliseconds();
        }
        /**
         * Append values into string for signing
         */
        $message = $consumerId."\n".$requestUrl."\n".strtoupper($requestMethod)."\n".$timestamp."\n";
        /**
         * Get RSA object for signing
         */
        $rsa = new RSA();
        $decodedPrivateKey = base64_decode($privateKey);
        $rsa->setPrivateKeyFormat(RSA::PRIVATE_FORMAT_PKCS8);
        $rsa->setPublicKeyFormat(RSA::PRIVATE_FORMAT_PKCS8);
        /**
         * Load private key
         */
        if($rsa->loadKey($decodedPrivateKey,RSA::PRIVATE_FORMAT_PKCS8)){
            /**
             * Make sure we use SHA256 for signing
             */
            $rsa->setHash('sha256');
            $rsa->setSignatureMode(RSA::SIGNATURE_PKCS1);
            $signed = $rsa->sign($message);
            /**
             * Return Base64 Encode generated signature
             */
            return base64_encode($signed);
        } else {
            throw new \Exception("Unable to load private key", 1446780146);
        }
    }

Open in new window


I have been able to get the milliseconds using the java code which is like below

<cfset jDate = createObject("java", "java.util.Date")>
<cfdump var="#jDate.getTime()#">

Open in new window



but other part of the php code i am unclear of what is happening
0
We are looking to upgrade our coldfusion server (v 6.1) running server (2003) to a new server (server 2012) and ColdFusion 2016.

Looking for a solution/upgrade path.. If I need to upgrade first to a lower version.

If its not semi simple then possibly moving to another dev language.

Thanks in advance!
0
Keep up with what's happening at Experts Exchange!
LVL 11
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

hi, i have the following json Code:

{"WhoisRecord": { "createdDate": "1997-09-15T00:00:00-0700", "updatedDate": "2015-06-12T10:38:52-0700", "expiresDate": "2020-09-13T21:00:00-0700", "registrant": { "name": "Dns Admin", "organization": "Google Inc.", "street1": "Please contact contact-admin@google.com, 1600 Amphitheatre Parkway", "city": "Mountain View", "state": "CA", "postalCode": "94043", "country": "UNITED STATES", "email": "dns-admin@google.com", "telephone": "16502530000", "fax": "16506188571", "rawText": "Registrant Name: Dns Admin\u000aRegistrant Organization: Google Inc.\u000aRegistrant Street: Please contact contact-admin@google.com, 1600 Amphitheatre Parkway\u000aRegistrant City: Mountain View\u000aRegistrant State/Province: CA\u000aRegistrant Postal Code: 94043\u000aRegistrant Country: US\u000aRegistrant Phone: +1.6502530000\u000aRegistrant Fax: +1.6506188571\u000aRegistrant Email: dns-admin@google.com" }, "administrativeContact": { "name": "DNS Admin", "organization": "Google Inc.", "street1": "1600 Amphitheatre Parkway", "city": "Mountain View", "state": "CA", "postalCode": "94043", "country": "UNITED STATES", "email": "dns-admin@google.com", "telephone": "16506234000", "fax": "16506188571", "rawText": "Admin Name: DNS Admin\u000aAdmin Organization: Google Inc.\u000aAdmin Street: 1600 Amphitheatre Parkway\u000aAdmin City: Mountain View\u000aAdmin State/Province: CA\u000aAdmin Postal Code: 94043\u000aAdmin Country: US\u000aAdmin Phone: 

Open in new window

0
I've been using  sys-con.com's code in my Application.cfc file to check for malicious input through FORM and URL variables, but I'm running into issues with hyphenated variable names (specifically Google's reCAPTCHA.) This is the code I use:

<cfloop collection="#form#" item="formelement">
    <cfif isSimpleValue(evaluate(formelement)) AND refindnocase(sqlregex, "#evaluate(formelement)#")>
        <cflocation url="messages.cfm?message=invalid">
        <cfset StructClear(form)>
	<cfabort>
    </cfif>
</cfloop>

Open in new window


And this is the error I'm receiving:

Variable G is undefined.

Which makes sense, because it's looking at g-recaptcha-response. What do I need to do to my code to allow it to accept hyphenated variable names?

Thanks!
0
We installed Coldfusion2016 on Windows Server 2012

On the server, the ColdFusion Administrator works flawlessly. The ColdFusion programs can be accessed without a problem when accessed on the server itself e.g. http://myServer:8500/CDM/customer/ /cfProgram1.cfm

However, when we access the ColdFusion programs from a PC on the network, we get error message.
HTTP Error 404.3 - Not Found The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

We read on the internet it has something to do with IIS. However, we are not that familiar with IIS.

Any help is greatly appreciated
0
I have the following sample code

<cfset testuser = {}>
<cfset testuser.data = []>
<cfset testuser.data[1] = "Test">
<cfset testuser.data[2] = "Test2">
<cfset testuser.data[3] = {}>
<cfset testuser.data[3].name = "user 1">
<cfset testuser.data[3].email = "user@email.com">
<cfset testuser.data[3].email = []>
<cfset testuser.data[3].email[1] = "Test@west.com">
<cfset testuser.data[3].email[2] = "Test2@opted.com">
<cfset testuser.data[3].email[3] = {}>
<cfset testuser.data[3].email[3].nameuser = "user 1user2">
<cfset testuser.data[3].email[3].emailuser = "user 2@email.com">

<cfdump var="#testuser#">

<cfloop from="1" to="#arrayLen(testuser.data)#" index="i">
  <cfset skdata = testuser.data[i]>
  <cfdump var= "#skData#"> //
  <cfif isArray(skdata)>
  <cfloop collection="#skdata#" item="key">
    #key#:#data[key]#
  </cfloop> 
  </cfif>
</cfloop>

Open in new window


I want to convert this code into a very simple flatten structure were i am using the following function to dobut that works only on first leveel ofstructs and does not consider arrays

<cffunction name="flattenStruct" access="public" output="false" returntype="struct">
	<cfargument name="original" type="struct" required="true"><!--- struct to flatten --->
    <cfargument name="delimiter" required="false" type="string" default="." />
	<cfargument name="flattened" type="struct" default="#StructNew()#" required="false"><!--- result struct, returned at the end --->
	<cfargument name="prefix_string" type="string" default="" required="false"><!--- used in the processing, stores the preceding struct names in the current branch, ends in a delimeter --->

	<!--- get this level's elements --->
	<cfset var names = StructKeyArray(original)>
	<cfset var name = "">
	
	<cfloop array="#names#" index="name">
		<!--- add name --->
		<cfif IsStruct(original[name])>
			<cfset flattened = flattenStruct(original[name], delimiter, flattened, prefix_string & name & delimiter)>
		<cfelse>
			<cfset flattened[prefix_string & name] = original[name]>
		</cfif>
	</cfloop>

	<cfreturn flattened>
</cffunction>

Open in new window


I am on ColdFusion version 9
0
Hi, Working on cfimage and trying to upload and resize and make image transparent from left to right like a gradient effect..

Like the Image starting from left will be good and till it reaches the right end point, it will be of gradient effect which will be white or transparent,

How can i fix it

I tried imageflip, imagetranspose but nothing seems to be working what i am trying
0
i m not able to access ColdFusion pages and admin page in our application. It is throwing 500 error with ROOT CAUSE:
coldfusion.server.ServiceFactory$ServiceNotAvailableException: The Debugging service is not available.

I m getting below info in the logs when starting CF server. We are using CF9 on unix server. Please help.

04/26 05:02:19 Information [main] - Starting scheduler...
04/26 05:02:19 Information [main] - Starting WatchService...
04/26 05:02:19 Information [main] - Starting debugging...
coldfusion.server.ParsingConfigFileException: [/export/home/web3b2/coldfusion/coldfusion9/lib/neo-debug.xml]coldfusion.wddx.WddxDeserializationException: WDDX packet parse error at line -1, column -1. Premature end of file..
      at coldfusion.server.ServiceBase.doDeserialize(ServiceBase.java:151)
      at coldfusion.server.ServiceBase.access$000(ServiceBase.java:37)


04/26 05:02:19 Error [main] - Unable to initialize Debugging service: coldfusion.server.ServiceException: [/export/home/web3b2/coldfusion/coldfusion9/lib/neo-debug.xml]coldfusion.wddx.WddxDeserializationException: WDDX packet parse error at line -1, column -1. Premature end of file..
0

ColdFusion Language

10K

Solutions

3K

Contributors

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
<
Monthly
>