Adobe User GroupColdFusion Users Group of WA

AJ Mercer

Blogging at http://webonix.net/
webonix.net :: Exploring the wonderful world of CFML

Railo Training in Australia

September 01, 2010
Railo Training in Australia

Railo are once again sponsoring cf.Objective(anz) with Gert Franz and Mark Drew attending the conference. As well as doing a couple of sessions, they will both be available before and after the conference to run the 3 day Railo Administrator Training Course.

The course is of a technical nature, though will cover some of the basics of CFML, and is aimed at those that are planning to use Railo in production and need to know everything about the background of the engine. You will learn very many details about the engine and its configuration. Here are a couple of highlights from the course:

  • Installing Railo
  • Configuring the application server
  • Performance tuning
  • JVM tuning
  • Railo tuning
  • Hardening the Railo Server

If you would like more information please email me at andrew@getrailo.org (or leave a comment here) and I will keep you up to date. Please let me know what state you are from and if any others from your company may be attending as well. If the numbers warrant it, the training could be taken to your state.

Also, please let me know if you are able to provide a venue - I am sure we could do you a good deal ;-)

For those that are thinking about becoming a Railo Partner, your company will need at least one certified person which can be done after the training. There is no cost in becoming a partner once you have a certified engineer. You just provide support and promote Railo.

gotta get some railo actionWhat is Railo?

Railo is a free open-source CFML Engine

This site is Running Mango Blog on Railo

Read Railo Training in Australia in full

Australia now has a Railo Community Manager

June 10, 2010
Australia now has a Railo Community Manager

...and it is me.

I have been a long time of CFML and over the last four years an ever increasing fan of Railo. This blog went live on Railo 15 October 2007. Gert Franz spent a lot of time with emails and Skye calls helping me set up my web server and we have been chatting about CFML and Railo ever since.

So last Thursday I get another call from him to discuss Railo AU, which I keep bugging him, and recently Peter Bell, about all the time. But this time he asks me if I would like to join the Railo Team and  be the Community Manager for Australia (and APAC). I felt very honoured to be offered this voluntary role and immediately accepted.

So if there is anything you would like to know or need assistance with I can be contacted at andrew @ getrailo . org

Read Australia now has a Railo Community Manager in full

ColdFusion Query of Query tips and tricks

March 04, 2010
ColdFusion Query of Query tips and tricks

Query of Query gives the developer that ability to manipulate a query result in memory. It is a real neat feature, but is very limited in what it can do and very quickly becomes extremely frustrating. It has a very limited range of SQL functions and syntax that almost makes it next to useless if you want to do anything serious with it. This blog post is a collection of things I have put to gather after many hours of scouring the 'net and even more trying to make it work. They include update and insert, sub-selects, and my latest - outer join.

I am using query QuerySim to create an populate a query to simulate a database table.

Everyone will no doubt be familiar with the normal SQL SELECT

<cfquery name="qryStudent" dbtype="query">
    SELECT id,fistname,surname,dob
    FROM VARIABLES.qryStudents
    WHERE id = <cfqueryparam cfsqltype="CF_sql_integer" value="#ARGUMENTS.id#" />
</cfquery>

To DELETE a record - slect everything except the record(s) to be removed

<cfquery name="VARIABLES.qryStudents" dbtype="query">
    SELECT #VARIABLES.fieldNames#
    FROM VARIABLES.qryStudents
    WHERE id != <cfqueryparam cfsqltype="CF_sql_integer" value="#ARGUMENTS.id#" />
</cfquery>

To save (INSERT or UPDATE) a record gets a little more interesting. As I mentioned, I am using QuerySim to create my query. I modified it slightly to accept datatypes as well, and I pass these in as variables.

    <cfset VARIABLES.fieldNames = 'id,fistname,surname,dob' />
    <cfset VARIABLES.fieldTypes = 'Integer,varchar,varchar,date' />

You would have noticed that I used VARIABLES.fieldNames in the DELETE SQL.

Passing data types to CreateQuery() will stop ColdFusion from guessing what the data types are and potentially screwing things up for you. Using a list of field names has a few benefits: it ensures fields are named, rather than select *; ensures fields are always selected in the same order; and you can programatically loop through them.

Rather than create sample code and potentially add mistakes, I will just show you my code that I have working

    <cffunction name="save" access="public" output="false" returntype="void">
        <cfargument name="createDate"  type="string" required="false" default="#Now()#" />
        <cfset var field       = '' />
        <cfset var fieldValues = '' />
        <cfset var qryMaxItems = QueryNew('id', 'integer') />
        <cfset var pk          = 0 />
        <cfif ARGUMENTS.endDate NEQ "">
            <cfset ARGUMENTS.endDate = ParseDateTime(ARGUMENTS.endDate) />
        <cfelse>
            <cfset ARGUMENTS.endDate = DateAdd('d', 14, Now()) />
        </cfif>
        <cfif ARGUMENTS.id EQ 0>
            <cfquery name="qryMaxItems" dbtype="query">
                SELECT MAX(id) as id
                FROM VARIABLES.qryItems
            </cfquery>
            <cfset pk           = qryMaxItems.id />
            <cfset ARGUMENTS.id = pk + 1 />
        <cfelse>
            <cfset pk = ARGUMENTS.id />
        </cfif>
        <cfquery name="VARIABLES.qryItems" dbtype="query">
            SELECT #VARIABLES.fieldNames#
            FROM VARIABLES.qryItems
            WHERE id != <cfqueryparam cfsqltype="CF_sql_integer" value="#ARGUMENTS.id#" />
            UNION
            SELECT
            <cfloop from="1" to="#ListLen(VARIABLES.fieldNames)#" index="field">
            <cfqueryparam cfsqltype="CF_sql_#ListGetAt(VARIABLES.fieldTypes, field)#" value="#ARGUMENTS[ListGetAt(VARIABLES.fieldNames, field)]#" /> as #ListGetAt(VARIABLES.fieldNames, field)#
            <cfif field NEQ ListLen(VARIABLES.fieldNames)>,</cfif>
            </cfloop>
            FROM VARIABLES.qryItems
            WHERE id = <cfqueryparam cfsqltype="CF_sql_integer" value="#pk#" />
        </cfquery>
    </cffunction>

Today I run into an issue that previously would have made me give up - OUTER JOIN. But based on what I have cobled together so far I thought I would be able to solve it. But before I could I had to solve another issue - SUB-SELECT.

A sub select is where you have WHERE id NOT IN (select ID FROM anotherTable). Whilst QoQ dooes support IN, it does not like a SQL in there. But you can use ColdFusion functions within a QoQ.

    <cfquery dbtype="query" name="qryClass">
    SELECT name
    FROM VARIABLES.qryClasses
    WHERE studentID NOT IN (<cfqueryparam cfsqltype="cf_sql_integer" value="#ValueList(VARIABLES.qrySudents.id)#" list="true"  />)
    </cfquery>

An OUTER JOIN is when you join multiple tables, with one table that may not have a record match for the other table, but you still want to see the data for that tables. What you end up with is NULLS for the values of the other table. What I ended up doing is doing a UNION, the first SELECT is all the results that match, and the second is all the values from the main table that were not in the first select, and empty stings for all the fields of the outer table, and then an ORDER BY. Once again, I will show working code.

<cfquery dbtype="query" name="qryCompanies">
 select qryCompanies.security as security,
        qryCompanies.exchange as exchange,
        qryCompanies.description as description,
     qryCompanies.companyName as companyName,
     qryCompanies.SECTYPE as secType,
     qryCompanies.GROUPTYPE as groupType,
     qryCompanies.gicsCode as gicsCode,
     qryCompanies.gicsName as gicsName,
     qryCompanies.gicsColourCode as gicsColourCode,
     qryCompanies.gicsParentColourCode as gicsParentColourCode,
     qryCompanies.gicsGroup as gicsGroup
 from qryCompanies,
      qryHoldings
 where qryCompanies.security = qryHoldings.security
   and qryCompanies.exchange = qryHoldings.exchange
   and (qryHoldings.AccountNumber = <cfqueryparam cfsqltype="cf_sql_varchar" value="#trim(ARGUMENTS.AccountNumber)#">)
 </cfquery>
 
<cfquery dbtype="query" name="qryCompanies">
select qryHoldings.accountNumber as accountNumber,
       qryHoldings.asOf as asOf,
    qryHoldings.exchange as exchange,
    qryHoldings.portfolioType as portfolioType,
    qryHoldings.security as security,
    qryHoldings.totalCost as totalCost,
    qryHoldings.unitCost as unitCost,
    qryHoldings.units as units,
    qryCompanies.description as description,
    qryCompanies.companyName as companyName,
    qryCompanies.SECTYPE as secType,
    qryCompanies.GROUPTYPE as groupType,
    qryCompanies.gicsCode as gicsCode,
    qryCompanies.gicsName as gicsName,
    qryCompanies.gicsColourCode as gicsColourCode,
    qryCompanies.gicsParentColourCode as gicsParentColourCode,
    qryCompanies.gicsGroup as gicsGroup
from qryCompanies,
     qryHoldings
where qryCompanies.security = qryHoldings.security
  and qryCompanies.exchange = qryHoldings.exchange
 
UNION
 
select qryHoldings.accountNumber as accountNumber,
       qryHoldings.asOf as asOf,
    qryHoldings.EXCHANGE as exchange,
    qryHoldings.portfolioType as portfolioType,
    qryHoldings.security as security,
    qryHoldings.totalCost as totalCost,
    qryHoldings.unitCost as unitCost,
    qryHoldings.units as units,
    '' as description,
    '' as companyName,
    0 as secType,
    '' as groupType,
    '' as gicsCode,
    '' as gicsName,
    '' as gicsColourCode,
    '' as gicsParentColourCode,
    '' as gicsGroup
from qryHoldings
where qryHoldings.security not in (<cfqueryparam cfsqltype="cf_sql_varchar" value="#ValueList(qryCompanies.security)#" list="true"  />)
</cfquery>

Notice that secType has zero rather than an empty string; that is because it is an integer, not a varchar. I am going to see if I can get a NULL in there - should be able to do something with a JAVA type. If I can get that going I will come back and clean up these examples.

This is a quick dump of what I have at least for my own records as no doubt I will have forgotten how and where I did all this by the next time I need it. If you have found it useful, or have any suggestions, please leave a comment.

Read ColdFusion Query of Query tips and tricks in full

I am speaking at webDU 2010

February 24, 2010
I am speaking at webDU 2010

come see me at webDU 2010 I have been to many webDU conferences, including the first one when it was called webMX, and am going this year too - but this time as a speaker

This will be my second time as a conference speaker. The first time was at the inaugural cf.objective(anz). My session was about not getting hung up on trying to build applications with design patterns and OO principle that you don't understand. The point being, if you don't understand them, they are not for you; they are to solve a particular problem, and if you don't understand it, then you probably don't have the problem. The session was just talking (well to be truthful, maybe a bit too much reading) - no slides, no code. I am not too sure if people want this sort of session. I whizzed through it way too fast (nerves), but had intending to have a general discussion at the end for people to share their experiences and thoughts. I think with bit may have saved my session - so thank you to those that participated in the chat.

This year, I will be continuing on with the same theme, but this time with slides, but probably more significantly, code. After taking a look at a few lite frameworks for ColdFusion, I have recently settled on Sean Corfield's Framework One framework. My originally thinking that these lite frameworks would be a stepping stone / learning application for the bigger frameworks, but the authors argue that their frameworks are industrial strength.

The session, after the obligatory introduction slides, will be going through not only the development life cycle of an application, but also your personal development as a developer. It will start off with the HTML mock up of a site, and how to move that into the FW/1 views and then set up layouts. From there move into simulated data and form posts, the 'bad way'. Next some re-factoring of the application to utilise controllers and services. I am also planning on covering security and time allowing, sub-sections.

Read I am speaking at webDU 2010 in full

In search of the Holy Grails of web development

February 10, 2010
In search of the Holy Grails of web development

Two things happened recently that have inspired me to step back from CFML and take a look at a different web development environment. Paul Kukiel post on how to install GlassFish and CF (with link to adding Railo)  and Dan Vega's post about a free Grails book.

A lot of CFML projects have taken inspiration from the JAVA, PHP and Rails world - ColdSpring, Transfer ORM (and more recently CF9 ORM), CFWheels, SplashCMS ... As CFML engines are JAVA based and can utilise JAVA classes easily, I have always thought if I was going to learn something else, it would be from the JAVA side of the fence; but just not JAVA. I have heard a few positive things from CF people about Groovy, and the Rails thing is popular at the moment, so Grails seems like it ticks all the right boxes.

So even if I don't be come a Grails developer, I still this there are 2 useful outcome; well maybe 3, but I am not entertaining that idea at the moment

  1. An understanding of where the CFML projects are coming from and perhaps learn better modeling techniques
  2. More appreciation of what CFML is doing for the developer
  3. A new career choice

So far I have spent a few hours going there the guide and am impressed by what Grails can do. And what is suprising me at the moment is that I am not fussed by the fact I am using command line and a text editor. I know there are IDE's out there, so if I do get serious I know there are better options. But also, using a text editor is a great way to learn new languages. It is too easy to look at code and think you understand it. But it is not until you spend a few minutes tracking badly cased class names or a missing curly bracket will you really learn the syntax.

I have taken a quick peak at the HTML Grails creates and it is not too dissimilar from CFML; there is ${variableName} verses #variableName# and <g:tag /> versed cfTag />.

I also created a war of my web app and dropped it into GlassFish - and what do you know, it run :-)

The other thing I am thinking about, but resisting the urge to get distracted at this early stage, is to call the classes created by Grails from CFML

Read In search of the Holy Grails of web development in full

Server Rebuild - Railo on Tomcat with Apache

January 12, 2010
Server Rebuild - Railo on Tomcat with Apache

I have decided to go with Apache and Tomcat for my Railo server, and so today rebulit the server from scratch. The server is still running Ubuntu 9.10 and I did a LAMP install.

Next I used Viviotech Railo installer - thanks Jordan. This installs Tomcat and Railo and then hooks it up to Apache (using mod_jk). Thanks also to the great people on the Railo list for helping me with Apache and Tomcat configurations for rewrite rules and Aliases.

For the records

Apache site config

<VirtualHost *:80>
    ServerAdmin admin@webonix.net
    ServerName    webonix.net
    ServerAlias    www.webonix.net

    DocumentRoot /path/to/webroot/
    DirectoryIndex index.cfm index.html

    RewriteEngine On
    RewriteCond %{HTTP_HOST} www\.webonix\.net [NC]
    RewriteCond %{HTTP_HOST} !^$
    RewriteRule ^/(.*) http://webonix.net/$1 [L,R]
    RewriteRule ^/post/(.*)$ /post.cfm/$1 [L,PT,QSA]
    RewriteRule ^/archives/(.*)/(.*)/(.*)$ /archives.cfm/$1/$2/$3 [L,PT,QSA]
    RewriteRule ^/archives/(.*)/(.*)$ /archives.cfm/$1/$2 [L,PT,QSA]
    RewriteRule ^/archives/(.*)$ /archives.cfm/$1 [L,PT,QSA]
    RewriteRule ^/page/(.*)$ /page.cfm/$1 [L,PT,QSA]
    RewriteRule ^/author/(.*)$ /author.cfm/$1 [L,PT,QSA]   
    RewriteRule ^/feeds/(.*)$ /feeds/$1.cfm [L,PT,QSA]
</VirtualHost>

/webroot/WEB-INF/web.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    version="2.5">
    <!-- The mapping for the Railo servlet -->
    <servlet-mapping>
        <servlet-name>CFMLServlet</servlet-name>
        <url-pattern>/post.cfm/*</url-pattern>
        <url-pattern>/archives.cfm/*</url-pattern>
        <url-pattern>/page.cfm/*</url-pattern>
        <url-pattern>/author.cfm/*</url-pattern>
    </servlet-mapping>
</web-app>

tomcat server.xml

<Host name="webonix.net"
      appBase="webapps"
      unpackWARs="true"
      autoDeploy="true"
      xmlValidation="false"
      xmlNamespaceAware="false">
      <Context path="" docBase="/path/to/webroot" />
</Host>

tomcat web.xml

<!-- The mapping for the Railo servlet -->
<servlet-mapping>
    <servlet-name>CFMLServlet</servlet-name>
    <url-pattern>*.cfm</url-pattern>
    <url-pattern>*.cfml</url-pattern>
    <url-pattern>*.cfc</url-pattern>
</servlet-mapping>

Read Server Rebuild - Railo on Tomcat with Apache in full

Lite Application Frameworks for ColdFusion

November 02, 2009
Lite Application Frameworks for ColdFusion


Recently there seems to have been some backlash against monolithic application for ColdFusion - they are too hard to learn, there require to much effort to set them up ...But probably the works criticism of all, is they take the fun out of ColdFusion development.

In reply to this, a number of 'lite' application frameworks have sprung up. For Example

So I was wondering,

  • how good are these frameworks?
  • can they hold there own again the big Frameworks?
  • and are they really easier to pick up and run with?

I was also wonder how the authors of the 'Lite' frameworks feel about

  • the framework used as a learning tool / stepping stone to a 'real' framework
  • they are for 'Hobbyists', not 'Real developers'

And in the future, will the authors feel the need to implement requests for developers that will turn the 'lite' framework into monolithic application?

Read Lite Application Frameworks for ColdFusion in full

Sign up for a piece of the CF.Objective(ANZ) action

September 07, 2009
Sign up for a piece of the CF.Objective(ANZ) action

The cf.objective(anz) committee have been working around the clock over multiple timezone and international banking laws and are now ready to accept your registration for CF.Objective(ANZ) 2009 in Melbourne, AU on November 12-13. Get in before October 12 for early bird price of $769

The conference speakers and program has been locked in and many Sponsors are getting behind this event.

Read Sign up for a piece of the CF.Objective(ANZ) action in full

A CFML framework for the rest of us - Reclaimed

August 22, 2009
A CFML framework for the rest of us - Reclaimed

After taking a look at FW/1 I posed a blog tittled 'A CFML framework for the rest of us'. Shortly afterwards, I got a comment (slightly tongue in cheek) from Chris Peters say that was ColdFusion on Wheels catch phrase / slogan.

I have not looked a cfwheels for a long time; about when the ownership changed hands and I think it may have had some issues with Railo (v2). So I downloaded and installed on Railo 3.1 and got the welcome page up :-) That motivated me to look at the excellent cfwheels documentation and do through the examples. The tutorials are very basic, but give you a good understanding of the philosophy behind cfwheels (which is based on Ruby on Rails).

I also took the opputunity to take a look at Russ Johnson's CMS built on cfwheels call Splash CMS. So far all I can say, besided saying it looks great, is that it does run on Railo 3.1; which will be no surprise to those that know Russ. I am hoping this will be a good project for me to dig into and see how to build applications with cfwheels and will blog about it shortly.

Read A CFML framework for the rest of us - Reclaimed in full

CF.Objective() Conference in Melbourne, Australia

August 14, 2009
CF.Objective() Conference in Melbourne, Australia

About 12 months ago Mark Mandel approached me and other ColdFusion User Group Managers to see if we would be interested in helping him bring CF.Objective() to Australia. I thought this was a brilliant idea and was happy to do what I could to make this happen. So very quickly a committee of keen Australians and CF.Objective() owners was formed. Then a stray Kiwi made his way into the group and cf.Objective(ANZ) was off the ground.

Adobe came on board as the main sponsor, and committed to sending some speakers. Then very quickly speakers from all over the world signed up to become speakers.

Lots of activities have been happening to make this conference come to life, and today we released the program for cf.Objective(ANZ). Find out more about cf.bjective(ANZ) here and make sure you follow cf.Objective(ANZ) on Twitter for the latest updates.

Thanks to every one on the committee for making this happen, and thanks to cf.Objective() for bringing the conference to Australia.

So, get out your magic marker and draw a big circle around 12th and 13th of November 2009, and start looking for cheap flights to Melbourne. I have got a flight home already - now to organise getting there.

 

Read CF.Objective() Conference in Melbourne, Australia in full

Time to get serious with frameworks

August 08, 2009
Time to get serious with frameworks

I have been taking a look at Framework One and it has motivated me again to learn OO development for ColdFusion. A part of this learning is to investigate Transfer ORM as well.

But like all good projects, it starts off with a bit of procrastination. So I have updated Railo to 3.1.0.26 and MangoBlog to 3.1. Now that is out of the way, time to get stuck in.

Hmmm, maybe some lunch first ...

13:37 Transfer tBlog seems to be running fine

Read Time to get serious with frameworks in full

A CFML framework for the rest of us

July 30, 2009
A CFML framework for the rest of us

I have been looking at a number of frameworks for awhile but have found them to be either:

  • too complex / hard to get my head around
  • seem like overkill for the applications I build
  • have too much plumbing for my liking

and on some occasions all of the above.

Sean Corfield (Mr Frameworks) is currently working on something that I think is going to suit me nicely - FW/1. Introducing Framework One will tell you all about it.

It is a conventions based framework, like cfWheels, that does not need a lot of configuration to get started. Something that I really like is you can start your site off with just views (and layouts), and then add controllers and services in later. This means you can have a site up and running very quickly; no messing around with plumbing / listeners / general OO headaches.

Conventions and auto-wiring feels a little like black magic at first, but once you understand the rules (FW/1 documentation is really good and there are plenty of example apps), it is a joy to work with.

And for a single file framework (one CFC of about 400 lines), it is no light-weight in terms of functionality; full MVC and hooks to popular bean factories like ColdSpring. It currently runs on ColdFusion, Railo and soon Open BlueDragon.

Read A CFML framework for the rest of us in full

Setting up Google Mail in Railo

May 27, 2009
Setting up Google Mail in Railo

Another one for my notes that may help others. Here are the settings to uses Google mail Server for send emails from Railo.

SMTP: smtp.gmail.com
Username: email@gmail.com
Password: *********
Port: 587
TLS: checked
SSL: not checked

Read Setting up Google Mail in Railo in full

Railo Express with Virtual Hosts

May 27, 2009
Railo Express with Virtual Hosts

I wanted to play around with Railo's Extentions without too much messing around. So I thought I would use Railo Express, but I wanted a web site per application, so they could run from the web root. After a bit of Googling (with google cache to the rescure for www.railo-technologies.com/en/index.cfm?treeID=211) I found out how to get this working. This blog is mostly for my personal records, but if it helps others that is great too.

In /contexts directory you will see railo.xml. Make a copy of this file, eg railo-mangoblog.xml, and then edit it.
Find the following
    <Set name="resourceBase">
        <SystemProperty name="jetty.home" default="."/>/webroot/
    </Set>
and change webroot to a new name, eg webroot-mangoblog

In the same file, uncomment the virtual hosts section and add you domain. eg
  <Set name="virtualHosts">
    <Array type="String">
      <Item>mangoblog.railo.org</Item>
    </Array>
  </Set>

Save this file.

Next create the directory you just defined in the same directory as webroot.

(Re)Start Railo using the BAT file(s). You should see a WEB-INF directory being created for you. You can now administor you site for that domain, eg http://mangoblog.railo.org/railo-context/admin/index.cfm

Read Railo Express with Virtual Hosts in full

Population PDF Forms with ColdFusion 8

May 14, 2009
Population PDF Forms with ColdFusion 8

Now that Adobe owns ColdFusion, a lot of PDF functionality has been added to CF8. Amongst that is the ability to populate PDF Forms. This means you can pre-populate forms for clients / members - how many times have you had to fill out a form and think to yourself, 'they already know this stuff!!'

The client / member can then update any info if required. With the proper licencing, you can save the data in the PDF, or have the PDF submit the data back to the web server.

Recently I was given the job of reproducing Contract Notes for clients. The origion is produced by printing the data onto stationary; but as the client wont have the sationary, this is not going to work. No drama for me, I am a CF developer :-)

The first think I did was to open up the PDF in Adobe Acrobat and add fields to the document to create the PDF form. This document is not to be alter by the client so licencing was not an issue. In fact, I get ColdFusion to flatten the file after it is populated so the client can not modify that data and then print it.

In previous of CF, you would hvae to use CFPDF to read the document, then other CF tags to get the fields and poplaute and bluh bluh bluh - doesn't matter any more cos CF8 simplifies all that with a new tag - CFPDFFORM and it's buddy CFPDFFORMPARAM

<cfpdfform source="#pdfPath##pdfDoc#"
                 destination="#pdfPath##pdfTemp#"
                 action="populate"
                 overwrite="yes" >
    <cfpdfformparam name="Branch" value="#qryCnote.BranchName#" />
    <cfpdfformparam name="Advisor" value="#qryCnote.AdvisorName#" />
</cfpdfform>

Just add a CFPDFFORMPARAM for each form field and give it a value <hand in the air and shout> 'Clear!'

And to get rid of the form fields, just use the flatten attributes.

<cfpdf action="write"
           source="#pdfPath##pdfTemp#"
           destination="#pdfPath##pdfTemp#"
           flatten="yes"
           overwrite="yes" />

And finally, push it back to the browser

<cfheader NAME='Content-Disposition'
               VALUE='attachment;filename=#saveAsName#' />
<cfheader name="cache-control" value="" />
<cfheader name="pragma" value="" />

<cftry>
    <cfcontent type="application/pdf"
                    file="#pdfPath##pdfTemp#"
                    deletefile="yes"

                    reset="yes" />
    <cfcatch>
    <!--- prevent unnecessary log entries when user
           cancels download whilst it is in progress
    --->
    </cfcatch>
</cftry>

Read Population PDF Forms with ColdFusion 8 in full