Adobe ColdFusion 8

Using the cfinvoke tag within the CFC definition

You can use the cfinvoke tag to invoke a component method within the component definition; for example, to call a utility method that provides a service to other methods in the component. To use the cfinvoke tag in this instance, do not create an instance or specify the component name in the cfinvoke tag, as the following example shows:

<cfcomponent>
    <cffunction name="servicemethod" access="public">
        <cfoutput>At your service...<br></cfoutput>
    </cffunction>
    <cffunction name="mymethod" access="public">
        <cfoutput>We're in mymethod.<br></cfoutput>
        <!--- Invoke a method in this CFC. --->
        <cfinvoke method="servicemethod">
    </cffunction>
</cfcomponent>

Note: When you invoke a method from within the component definition in which you define the method, do not use the This scope, because this resets the access privileges.