Getting Started

Tag Reference

Object Reference

Case Study


Mailing List

Other Links


Calls (executes) a method of an object or class.

Attribute Description Default Required Deprecated
OBJECT A reference to an object previously created with cfoCreateObject. Required for methods declared as TYPE="public".   No Yes
METHOD The namespace of the method to invoke.   Yes No
CLASS The name of the class containing the method. Normally, this attribute should be excluded. However, may be used to invoke a method within a specific class within an inheritance hierarchy, or may be used to invoke "static" methods.   No Yes
PACKAGE Only applies to STATIC methods. PUBLIC methods will use the package defined during cfoCreateObject.   No Yes
ONEVENT This attribute tells cfObjects to invoke this method only when it encounters an entry in the Event Handler Pool (defined by the cfoRaiseEvent tag)   No No

This basic example creates a local object named "aCustomer" from the Customer class, and then the dump method is executed.

<cf_cfoCreateObject class="Person.Customer">

<cf_cfoInvokeMethod method="aCustomer.dump">

This next example demonstrates how the special base identifier can be used to call a superclass method from within a subclass method. For example, assume the Customer class is a subclass of the Person class. Now assume that the Customer class has a constructor method, and Person also has a constructor. In order to call the Person constructor from within the body of the Customer constructor method, the base identifier is used on the #self# object.

<cf_cfoInvokeMethod object="#self#"" method="base.constructor">
<!--- do other stuff here --->
<cfparam name="self.accountNumber" default="">

cfObjects version 2
cfObjects version 3