Invoke

Description

Does either of the following:

  • Invokes a component method from within a ColdFusion page or component

  • Invokes a web service

Returns

Returns what is returned by the invoked method.

Syntax

invoke(cfcinstance, methodname [, arguments])

Properties

Parameter

Description

cfcinstance

Required. String or component object; a reference to a component, or component to instantiate.

methodname

Required. Name of a method. For a web service, the name of an operation.

arguments

Optional. Arguments to pass to the method.

Example

<cfscript> 
obj = createObject("component","TestComponent"); 
invoke(obj,"function1",{a1="ColdFusion"}); 
</cfscript>