I have a test.cfm
page and would like to call a cfc with a <cffunction>
named errorEmail
using <cfscript>
from that page (test.cfm) instead of
<cfinvoke component = "#cfcPath#" method = "errorEmail" returnVariable = "myReturn"
description = "get list of projman">
</cfinvoke>
I have tried:
<cfscript>
errorEmail(cfcPath);
</cfscript>
I do this all the time.
1) Create the object:
<cfscript>
// CREATE OBJECT
TheCFC = createObject("component", "thecfc");
</cfscript>
2) Call the function:
<cfscript>
// CALL THE FUNCTION
SomeVariable = TheCFC .theFunction();
</cfscript>
Your version would look like this
<cfscript>
// CREATE OBJECT
TheObject = createObject("component", "cfcPath");
// CALL THE FUNCTION
myReturn = TheObject.errorEmail();
</cfscript>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With