Dave Merrill
05/06/2024, 4:38 PMsomeData = cfinvoke(component="dotPathToService", method="someMethod", someArg="foo");
That throws the error "Variable CFINVOKE is undefined."
CFDocs says cfinvoke has existed since cf6, it's documented by Adobe too.
I most often use createObjectI) then call the methods I want on that object, but this is a one-off call, won't need the service again, so I thought this should do it, but I guess I'm missing something dumb.
Or maybe that error is erroneous?Jim Frankowski
05/06/2024, 5:00 PMcfinvoke( returnVariable="res", method="getLastTradePrice", component="nasdaq.quote" ) {
cfinvokeargument( name="symbol", value="macr" );
}Dave Merrill
05/06/2024, 5:08 PMAdam Cameron
cfinvoke when you could just go someData = new dotPathToService().someMethod(someArg="foo"). Why add all the "generic tags in script" bloat?Adam Cameron
<cfinvoke> was added in CFMX6, but the generic tags-in-script syntax was only introduced in CF11, and even then it was only added where there was not already a CFScript equivalent, which there already is: invoke. In your case, you'd write:
someData = invoke("dotPathToService", "someMethod", {someArg="foo"});
But just... don't. Just use new and chain the method call.