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

Good morning all, I have a question related to writing an Excel spreadsheet from ColdFusion (XML). I'm not sure if my problem is my Oracle query, or the way I have the XML put together, but I'm getting some errors when I do certain things. I've attached the code that I'm working with and will try to explain what I'm doing. I'm dealing with two tables, "BUDGET_MIPRS_SENT" and "UNOB_REMARKS". This is a one to many, where I may have several remarks listed in UNOB_REMARKS for a specific entry in BUDGET_MIPRS_SENT. What I want to do is be able to have a spreadsheet that has only the three most recent "remarks" rather than all of the remarks for each record in BUDGET_MIPRS_SENT. So I guess I want to group the remarks together and have a single record on the spreadsheet with the 3 latest remarks grouped together. The way I have the query works when I display on a web page, but when trying to get a spreadsheet I get an error:

Context validation error for tag cfoutput. Either the end tag &lt;/cfoutput&gt; encountered on line 669 at column 3 requires a matching start tag or tag cfoutput does not support end tag. <br>The error occurred on line -1. | Referer: | Template: /mcadev/reports/testreport.cfm |
testreport.txt
0
Free Tool: Path Explorer
LVL 12
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Good afternoon, I was hoping I could get some help. I am trying to send email with attachments with ColdFusion. It would be multiple attachments based on files in a folder. Those files are uploaded during a submission of a form, and that part works well but I'm getting an error whenever I try to attach those files to an email with the cfmail parameter. Below is just some test code:

<CFDIRECTORY NAME="myfiles1"
  DIRECTORY="f:\Websites\MCA\MCA\TempUpload\"
  FILTER="*.*"
  SORT="DateLastModified DESC">

and then my email code is:

<CFPROCESSINGDIRECTIVE SUPPRESSWHITESPACE="No">
<cfmail query="MCALeads"
SUBJECT="!!! HIGH PRIORITY !!! APPROVAL"
FROM="hft@mail.com"
TO="hft@mail.com"
CC="hft@mail.com"
BCC="hft@mail.com">
      
<cfloop query="myfiles1">
<cfmailparam file="#myfiles1.name#">
</cfloop>

-------------------------------------------------------------------------------
STATUS: APPROVED !!! THIS IS A HIGH PRIORITY ACTION !!!

Budget Office,

Please prepare

</cfmail></CFPROCESSINGDIRECTIVE>

I get an error message through the ColdFusion log:
Message: The resource 2292-GSAFEDSIMMIPRInstructions.doc was not found. The root cause was: ''. <br>The error occurred on line 57. | Referer: | Template: /mcadev/emailtest.cfm

I thought maybe ColdFusion wasn't seeing the files, but I renamed the file, and it sees the renaming in the error message so I am at a loss. Any help would be greatly appreciated!!
0
We are using an external website to send SMS to our clients from with ColdFusion.

The external website takes the phone number and message and delivers the SMS to the client.  

The URL to the website is http://SMSCOMPANY.CODE.aw/custom/HIDDEN.php?sms_to=PHONE&msg=MESSAGE  " 

When I use the below code, only one SMS is sent.

<cfset aAr1[1][1] = '1234567'>                        <!--- Phone number --->
<cfset aAr1[1][2] = 'Message to 1234567'>      <!--- SMS message to customer --->


<cfset aAr1[2][1] = '7654321'>                        <!--- Phone number --->
<cfset aAr1[2][2] = 'Message to 7654321'>      <!--- SMS message to customer --->


<cfset aAr1[3][1] = '2222222'>                        <!--- Phone number --->
<cfset aAr1[3][2] = 'Message to 2222222'>      <!--- SMS message to customer --->


<cfset aAr1[4][1] = '3333333'>                        <!--- Phone number --->
<cfset aAr1[4][2] = 'Message to 3333333'>      <!--- SMS message to customer --->


<cfloop index="nIdx" from="1" to="#arrayLen(aAr1)#" >

      <cflocation url="http://SMSCOMPANY.CODE.aw/custom/HIDDEN.php?sms_to=#aAr1[nIdx][1]#&msg=#aAr1[nIdx][2]# " >

</cfloop>

Someone told me I should use CFTHREAD but I have never worked with CFTHREAD.


Any help is greatly appreciated
0
I am trying to convert some coldfusion code to jsp and there are some tags like cfargument,cf:loop,cf:return,cf:location.. can anybody tell me what to use in place of these tags in jsp?
0
calculate the next send date. I have the survey that starts on some date and ends on some date. I need to be able to send the email every 3 days from the survey start until the survey end
0
Can't seem to figure out how to save this html table as an excel file or csv. My preference is to be able to write it directly to a MySQL table using ColdFusion but can't figure out how to do that either because the html table is just an output of a complex set of queries that include summary calculations, etc. I am ultimately trying to consolidate a MySQL table that has nearly 100,000 rows into a new table that calculates and summarizes the overall rows into a summary table like this page.

http://day6management.com/Scripts/distro_comp.cfm

I intend to simply import the excel or csv to my MySQL database as a new table using PHPMyAdmin's import tool. I hate that I need this extra step, but I am not a good enough coldfusion programmer to know how to build an array, etc. It's just too complex for my experience. So this is my possible workaround.
0
Am using a custom tag and am getting an Invalid CFML Construct error on the following:

Invalid CFML construct found on line 27 at column 10.

26 : <cfscript>
27 : cfparam( 'attributes.action', 'new' );
28 : cfparam( 'attributes.fieldList', '' );
29 : cfparam( 'attributes.return', 'variables' );
0
Hello,

I am a coldfusion developer.  I have a probably dumb question.  If we want to create some JAVA we apps, would we be able to run those on our coldfusion server?

I know that CF runs on Java, so I am guessing the answer is yes, but am unsure.

Are there java web servers?  Or do people run java on IIS, APache, etc?

Thanks for any info.

-Bonnie
0
How many folks here are security experts in ColdFusion?

--Ben
0
Good morning everyone...I have a question/problem which I hope is simple but I'm having a hard time coming up with a solution., I have a simple query, and that query will return several rows of information about a specific project. Each row has a specific id number. I can display the query results using CFLOOP and everything works fine. But what I want to do is a) only show three records (the last three entered) instead of every records and then b) have a button or link where the user can select to show the remaining records. My query is below:

<CFQUERY DATASOURCE="MCA_Oracle" NAME="GetExcludeCurDocCommentList">
 SELECT UNOB_REMARKS.*
 FROM MCA.UNOB_REMARKS
 WHERE UNOB_REMARKS.MIPR_ID = '#SESSION.urlpass.MIPR_ID#'
 ORDER BY UNOB_REMARKS.LAST_REMARK_UPDATE DESC
 </CFQUERY>

and then all I'm doing with the CFLOOP is:

<TABLE>


<CFLOOP query="GetExcludeCurDocCommentList">
<TR>
<TD><CFINPUT TYPE="Text"
                     NAME="Exs_DATE"
                     VALUE="#DateFormat(GetExcludeCurDocCommentList.LAST_REMARK_UPDATE,'mm/dd/yyyy')#"
                     SIZE="12"
                     MAXLENGTH="25"
                     style="border-color:WHITE; border-width:2; background-color:D1D0CE" readonly="Yes"></TD>

<TD><textarea rows="2" cols="73" name="Exs_Remark" style="border-color:WHITE; border-width:2; background-color:D1D0CE" readonly>#GetExcludeCurDocCommentList.REMARKS#</textarea></TD>

<TD><CFINPUT TYPE="Text"
                     …
0
Get expert help—faster!
LVL 12
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

how do I reset where a CF Tag file is being pulled from within a cold fusion file?

debug is providing these filepaths:

Total Time Avg Time Count Template
0 ms 0 ms 1 D:/inetpub/wwwroot/CF_Tags/InetRightLinks.cfm
0 ms 0 ms 1 D:/inetpub/wwwroot/CF_Tags/InetTopLinks.cfm
0 ms 0 ms 1 D:/inetpub/wwwroot/bottomInet.cfm
0 ms 0 ms 1 D:/inetpub/wwwroot/centralinv/InetTopHierMenu.cfm
0 ms 0 ms 1 D:/inetpub/wwwroot/secure/CF_Tags/InetCGLinks.cfm
0 ms 0 ms 1 D:/inetpub/wwwroot/secure/InetDate.cfm
0 ms 0 ms 1 D:/inetpub/wwwroot/secure/InetLeftMenu.cfm
0 ms 0 ms 1 D:/inetpub/wwwroot/secure/payment.htm
0 ms   STARTUP, PARSING, COMPILING, LOADING, & SHUTDOWN
0 ms   TOTAL EXECUTION TIME


Within the file the CF_InetLeftMenus.cfm file for instance? What is directing the htm file, payment.htm in this case, to pull from that directory vs. the CF_tags file under inetpub or wwwroot. Any yes I know the CF-Tag file configuration is messed up. Old set up I had nothing to do with.

I'm assuming something needs to be modified w/in the CF admin panel but what?
0
I have a search (with drop downs and input boxes) and results page using ColdFusion and Access. Displayed on the results is a link to a new search page with some criteria automatically filled for the user, and will click on the submit button to view the results.

Note: the search and results are on one page of code

How can I alter my link to automatically submit to view the results in lieu of having the user click submit?
Link code:
<a href="Search.cfm?RE=#RE#&JU=#JU#&SE=#SE#" target="_blank" ><font size=3>#RE#-#JU#-#SE#</font></a>

Open in new window

0
Excel report output for date format isn't working as it did w/in html:

Will this work with an excel output? I'm getting an error when I try to use it the same way See the enter_que output below:

<cfoutput> 

#cellbeg# Queue Name #cellend# #cellbeg# Fifo Flag #cellend# #cellbeg# User ID #cellend# #cellbeg# Due Date #cellend# #cellbeg# Document ID#cellend# #cellbeg# Invoice Number #cellend# #cellbeg# Material Amount #cellend# #cellbeg# Discount Terms Percent #cellend# #cellbeg# Discount Terms Days #cellend# #cellbeg# Discount Terms Net #cellend# #cellbeg# FINCENDT #cellend# #cellbeg# Markview #cellend# #cellbeg# Work Item #cellend# #cellbeg# Date Entered Queue #cellend# 

</cfoutput> </font>
</tr>

<cfoutput query="queueData">
#begline#
#cellbeg1# &nbsp;#queueData.queue_name# #cellend# #cellbeg1# &nbsp;#fifo_flag# #cellend# #cellbeg1# &nbsp;#RETRIEVING_USER_ID# #cellend# #cellbeg1# &nbsp;#queueData.due_date# #cellend# #cellbeg1# &nbsp;#queueData.document_id#  #cellend# #cellbeg1# &nbsp;#queueData.invoice_num# #cellend# #cellbeg1# &nbsp;#queueData.material_amount# #cellend# #cellbeg1# &nbsp;#queueData.percent#  #cellend# #cellbeg1# &nbsp;#queueData.days# #cellend# #cellbeg1# &nbsp;#queueData.net# #cellend# #cellbeg1# #queueData.FINCENDT# #cellend# #cellbeg1# #queueData.markview# #cellbeg1# #queueData.workitem#  #cellbeg1# #queueData.dateFormat(enter_que,"mm/dd/yyyy")# 
#endline#
</cfoutput> 

Open in new window

0
I am running a test in SpIDER WEB and it returns the following error message , How can I fix the error to avoid vulnerability
FireShot-Capture-1---Vulnerability-R.png
FireShot-Capture-4---Vulnerability-R.png
0
I'm having output issues with a cold fusion file using a sql query. The code for the file is:

<cfset today = DateFormat("#Now()#","mm/dd/yyyy")> 
<cfset time = TimeFormat("#Now()#","hh:mm:sstt")>
<cfset #dsn# = "prod1_r">
<cfset CurrentPage=GetFileFromPath(GetTemplatePath())>

<cfquery name="queueData" datasource="#dsn#">
Select 
     distinct q.queue_name, 
     INV.FIFO_FLAG, 
     WI.RETRIEVING_USER_ID,
       decode(TO_NUMBER(inv.discount_terms_days), null, 
              inv.document_receipt_date + inv.discount_terms_net, 0, 
              inv.document_receipt_date + inv.discount_terms_net, 
              inv.invoice_date + inv.discount_terms_days) due_date, 
       inv.document_id,
       inv.invoice_num, 
       inv.material_amount, 
       lpad(TO_NUMBER(inv.discount_terms_percentage),5,0) percent,
       TO_NUMBER(inv.discount_terms_days) days,
       TO_NUMBER(inv.discount_terms_net) net,
       TO_DATE(wpv.property_value,'DD-MON-YYYY')  FINCENDT,
       inv.markview_document_id markview,
       wi.workitem_instance_id workitem, 
       trunc(wi.enqueued_timestamp) Enter_que
  From sf_workitem_instance wi,
       sf_workitem_property_value wpv,
       wins_invoices inv,
       sf_queue q
where wi.queue_id = q.queue_id 
   and wpv.WORKITEM_INSTANCE_ID = wi.WORKITEM_INSTANCE_ID
   and inv.workitem_instance_id = wi.workitem_instance_id
   and wpv.WORKITEM_CLASS_PROPERTY_ID in (1046,187)
   and wi.queue_id not in (120,14,40)
   and q.queue_name <> 'Associated'

Open in new window

0
The attached file is throwing an error:

Error Executing Database Query.  
[Macromedia][Oracle JDBC Driver][Oracle]ORA-00911: invalid character  
 
The error occurred in D:/inetpub/wwwroot/23_Reports/23QueueStatusDetailRpt.cfm: line 28
 
26 : <cfset grandCount = 0>
27 :
28 : <cfquery name="queueData" datasource="#dsn#">
29 : Select
30 :      distinct q.queue_name,

I've attached the cfm file in .txt format

Does anyone see why this is being thrown? Its working in another report with a different query but I can't find why it's being thrown.

Thanks,
query23.txt
0
I need help with understanding a sql select statement. I'm new to sql and learning but I'm not sure what the select statement is trying to output with the decode_TO NUMBER code See below for the example:

Select distinct q.queue_name, 
		INV.FIFO_FLAG, 
        WI.RETRIEVING_USER_ID,
       decode(TO_NUMBER(inv.discount_terms_days), null, 
              inv.document_receipt_date + inv.discount_terms_net, 0, 
              inv.document_receipt_date + inv.discount_terms_net, 
              inv.invoice_date + inv.discount_terms_days) due_date, 
       inv.document_id,
       inv.invoice_num, inv.material_amount, 
       lpad(TO_NUMBER(inv.discount_terms_percentage),5,0) percent,
       TO_NUMBER(inv.discount_terms_days) days,
       TO_NUMBER(inv.discount_terms_net) net,
       TO_DATE(wpv.property_value,'DD-MON-YYYY')  FINCENDT,
       inv.markview_document_id markview,
       wi.workitem_instance_id workitem, 
       trunc(wi.enqueued_timestamp) Enter_que

Open in new window


What would the output be for each of these be? I get the Queue Name, FIFO Flag, User ID  but not sure about what's being requested for that section.
0
I have a report that I need to run after selecting an HTML or Excel option then after hitting submit the report would run automatically and pull up the queried results from a sql query. I'm having issues getting the report to automatically run after hitting the next button. Below is the code I'm using to go to the next page:

												    <cfform name="form1" method="post" action="html.htm">
													
                                                   <tr>
                                                   <cfselect name="test">											  
                                                     <option name="html" type="radio" value="html">
                                                     HTML
                                                     </option>
                                                     <option name="excel" type="radio" value="excel">
                                                     Excel
                                                     </option>                                                  
                                                     </cfselect>
                                                   </tr>                                      
                                                      
                                                   <tr>
                                                      <td colspan="3" class="maintxt12">
                                                        <input type="submit" 

Open in new window

0
This is my Piece of code:
      // Procedure to get results
     <cfquery name="ExportData" datasource="#session.DataSource#">
                  EXEC xxx 6, #yy#,'#Dateformat(now(),'mm/dd/yyyy')#','#StartDate#', '#EndDate#', #rx#, NULL
   </cfquery>

This procedure gives the result set more than 1 lakh records.From this I formed the 'QoQ' from the above procedure.

'Query of Queries to get result set'

   <cfquery name="Residents" dbType="query">
                  SELECT ContactID, State, Location, Name, MIDate, MODate, MoveOutReason, MovedToDesc, DateOfBirth, Race, Gender, FirstTotalPts, LastTotalPts
                  FROM ExportData
                  WHERE SectionIND = 'Residents'
            </cfquery>

    <cffunction name="QueriesToXLS" access="public">
    <cfargument name="queryArr" required="true" /><!--- An Array of Query Objects --->
    <cfargument name="sheetNameArr" required="false" /><!--- Optional sheet names to use instead of "Sheet1","Sheet2",... --->
    <cfset tempPath = GetTempDirectory() & CreateUuid() & ".xlsx" /><!--- Creaete a Temp XLS File --->
    <cfset counter = 1 />
    <cfloop array="#ARGUMENTS.queryArr#" index="i">
        <cfset sheetName = "Sheet#counter#" />
         <cfif isDefined("ARGUMENTS.sheetNameArr")>
            <cfset sheetName = ARGUMENTS.sheetNameArr[counter] />
        </cfif>
        <cfspreadsheet action="update" filename="#tempPath#" query="i" sheetName="#sheetName#" />
        <cfset counter += 1 />
    </cfloop>
    <cfreturn SpreadsheetRead(tempPath) />
    …
0
Free Tool: Subnet Calculator
LVL 12
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

I am running a test in SpIDER WEB and it returns the following error message , How can I fixe the error to avoid volnuarability

Attack Type  - double Quote (double ASCII)
Original value - page
Attack Value - page%25%22
Error : Select folio ,pgname,name
from tbl
where upper(pgname) = '1B'</font><td></tr></
0
Hi,

What account does CF use when applying hotfixes? I have it locked down and may have limited the access a bit too much.  Tried to apply HF 13 and got the following:

Moving files failed:
                          Status: FATAL ERROR
                          Additional Notes: FATAL ERROR - Could not move the file <root folder>\lib\updates\chf11000012.jar to the backup location d:\wwcf\cfusion\hf-updates\hf-11-00013\backup\lib\updates\chf11000012.jar

Moving files failed:
                          Status: FATAL ERROR
                          Additional Notes: FATAL ERROR - Could not move the file <root folder>\lib/xmpcoreold.jar to the backup location <root folder>\hf-updates\hf-11-00013\backup/lib/xmpcoreold.jar

Moving files failed:
                          Status: FATAL ERROR
                          Additional Notes: FATAL ERROR - Could not move the file <root folder>\lib/nekohtml.jar to the backup location <root folder>\hf-updates\hf-11-00013\backup/lib/nekohtml.jar

Moving files failed:
                          Status: FATAL ERROR
                          Additional Notes: FATAL ERROR - Could not move the file <root folder>\lib/antisamy-1.5.3.jar to the backup location <root folder>\hf-updates\hf-11-00013\backup/lib/antisamy-1.5.3.jar

Failed to delete directory
                          Status: ERROR
                          Additional Notes: ERROR - Failed to delete directory:<root folder>/lib/xmpcoreold.jar
                            …
0
I have a table called myUsers with 1000 UserID's.  This table is the result of a query.  

I have another table called EmailSent that records every email sent to a UserID and which EmailTemplate was used.

How do I get the subset of those 1000 myUsers that have not yet received  EmailTemplate = "Template1.cfm"

This is so I can send the remainder of the UserIDs, the email.

I could do this with spaghetti code but prefer to do it within a CFquery tag.
0
Hi,

How do I join these two databases?

db1: Visitors
Table: Users
This table contains all users on the system.  each one has a unique "UserID"


db2:  PT_UserData
Table: Client_Scores
This table contains only those users who have completed a test
If they complete a test, the field "YourType" IS NOT NULL
All rows contain the field "UserID"


Both tables have "UserID" in common

I'm looking to output those users who have completed the test, but I need their Email and LastName which is in the Users table
0
Queries that use a join always baffle me so I could use some expert advice. Thanks in advance...

How to I write a ColdFusion query where:

I have one database called "Visitors"

I have 2 tables in that database:
"Users" is a table with my entire membership listing
"EmailSent" is a table listing every newsletter sent to each member

The common field is "UserID"

Within EmailSent is a field called "TemplateUsed" which is a different template for each version of the newsletter.

I need a query that will output the UserID's of those members who did not yet receive a particular template called "ImportedCareerCoach5.cfm"

But they may have received other newsletters.

Hope that makes sense.

 I'm running CF 10 and MS SQL
0
I am trying to create a simple HTML table and for some reason the columns in the header are not the same width has in the body. My code looks like:
	<table class="table AdTableStyle1 ManageSched" id="UserSchedule" border="1" cellpadding="4" cellspacing="0">
		<thead>
			<tr>
				<th >Day</th>
				<th >Date <span style="font-size:10px">(mm/dd/yyyy)</span></th>
				<th >Start Time</th>
				<th >End Time</th>
			</tr>
		</thead>
		<tbody>
			<cfloop index="thisRow" from="1" to="#arrayLen(sched.data)#">
				<cfoutput><tr>
					<td>#sched.data[thisRow].day#</td>
					<td>#sched.data[thisRow].date#</td>
					<td>#sched.data[thisRow].starttime#</td>
					<td>#sched.data[thisRow].endtime#</td>
				</tr></cfoutput>
			</cfloop>
		</tbody>

	</table>

Open in new window

Capture.PNG
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
>