ColdFusion MX Tag and Function Reference

A compact recognition guide to the tags, files, scopes, and functions most likely to appear in an MX-era application.

Purpose: This is a practical recognition guide, not a replacement for the complete vendor language reference. Compatibility can depend on the exact updater and edition.

Core Control and Output Tags

TagUse
cfsetAssign a variable or call a function.
cfoutputEvaluate expressions and output query rows.
cfif, cfelseif, cfelseConditional flow.
cfswitch, cfcaseMulti-branch selection.
cfloopNumeric, list, collection, condition, or query loops; remember that direct array looping is later than MX.
cfincludeExecute another template in the current context.
cfparamSet a default and optionally validate type.
cfabortStop request processing.
cflocationSend a redirect; commonly use addtoken="false".
cfheader, cfcontentControl HTTP response headers and content.

Database Tags

TagUse
cfqueryExecute SQL or Query of Queries.
cfqueryparamBind and validate a dynamic SQL value.
cftransactionGroup related database operations atomically.
cfstoredprocCall a stored procedure with parameters and results.

Application and State

Tag/FileUse
cfapplicationDefine classic application and session settings.
Application.cfmRun application setup at the beginning of each request.
OnRequestEnd.cfmRun request-end template logic in the classic model.
Application.cfcMX 7+ lifecycle component.
cflockCoordinate access to shared scopes or named resources.
cfcookieCreate or expire browser cookies.

Components and Functions

TagUse
cfcomponentDefine a CFC.
cffunctionDefine a method or user-defined function.
cfargumentDefine a function argument.
cfreturnReturn a value.
cfinvokeInvoke a CFC method or web service.
cfobjectCreate certain component, COM, CORBA, Java, or web-service objects.
cfpropertyDescribe component properties and service metadata.

Integration and Files

TagUse
cfmailSend email.
cffileRead, write, append, move, delete, or upload files.
cfdirectoryList and manage directories.
cfhttpCall an HTTP endpoint.
cfftpInteract with FTP servers.
cfexecuteRun an external process; high-risk and often restricted.
cfldapQuery or modify an LDAP directory.

Errors and Diagnostics

TagUse
cftry, cfcatchHandle exceptions.
cfthrow, cfrethrowCreate or propagate exceptions.
cferrorConfigure classic request or exception error templates.
cflogWrite an application log entry.
cfdumpInspect variables during development.
cftraceAdd information to debugging output.

MX 7 Features Commonly Seen

FeatureUse
Application.cfcApplication lifecycle methods.
cfdocumentGenerate PDF or FlashPaper output from content.
cfreportGenerate reports designed with Report Builder.
cfcalendar, Flash forms, XFormsRich form controls associated with the era; usually replace rather than revive for modern public applications.
Event gatewaysEnterprise integrations for asynchronous events such as messaging, SMS, and directory watching.

Frequently Used MX-Compatible Functions

ArrayNew, ArrayAppend, ArrayLen, StructNew, StructKeyExists, StructInsert, ListFindNoCase, ListLen, Trim, Len, LCase, UCase, Val, DateFormat, TimeFormat, CreateDateTime, CreateTimeSpan, HTMLEditFormat, URLEncodedFormat, Hash, CreateUUID, ExpandPath, GetDirectoryFromPath, GetCurrentTemplatePath, and CreateObject.

Fast Legacy-Code Reading Checklist

  • Which scopes are used explicitly and implicitly?
  • Is every dynamic SQL value parameterized?
  • Are CFC method variables declared with var?
  • Which files are application entry points?
  • What depends on Administrator configuration?
  • Which templates are remotely reachable?
  • Where are output encoding and authorization enforced?
  • What scheduled tasks or external systems call the application?