You can use the <cfinvoke> but the <cfinvoke> creates the CFC, calls a
method, and then destroys the CFC.  So, if you need to call only a single
method from a CFC, then it's ok to use <cfinvoke>.  If you need to call
multiple methods from same cfc instance, then <cfinvoke> uses a lot of
overhead.

Most of the time you will need to call multiple methods of an object.  So
you can use createobject method within a <cfscript> block:

<cfscript>
        oCFC = createObject("component","Package.Path.To.Where.CFC.Lives");
        oCFC.method1(paramName=paramValue,paramName1=paramValue1,...);
        oCFC.method2(paramName=paramValue,paramName1=paramValue1,...);
        etc.
</cfscript>

Another alternative to passing a list of name/value pairings is to create a
structure containing data and use argumentcollection=structureName in place
of all the name/value pairings.

Thanks
 
Tom Schreck
972-361-9943
-----Original Message-----
From: Chris Gomez [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 09, 2005 8:31 AM
To: [email protected]
Subject: CFC question

At last nights meeting, it was brought up that CFC's should not be
called using the CFINVOKE command. If that's the case, then how would
you call a CFC and, more importantly, how do you call a CFC that
requires arguments be passed to it?

Thanks,

Chris
----------------------------------------------------------
To post, send email to [email protected]
To unsubscribe: 
   http://www.dfwcfug.org/form_MemberUnsubscribe.cfm
To subscribe: 
   http://www.dfwcfug.org/form_MemberRegistration.cfm

----------------------------------------------------------
To post, send email to [email protected]
To unsubscribe: 
   http://www.dfwcfug.org/form_MemberUnsubscribe.cfm
To subscribe: 
   http://www.dfwcfug.org/form_MemberRegistration.cfm


Reply via email to