Cannot invoke method foo on an object of type coldfusion.runtime.VariableScope with named arguments.
Use ordered arguments instead.
Sample code
<cffunction name="foo" returntype="boolean" output="false">
<cfargument name="bar" required="false" />
<cfreturn true />
</cffunction>
<cfscript>
foo('Hello World'); // Works
foo(bar = 'Hello World'); // Works
variables.foo('Hello World'); // Works
variables.foo(bar = 'Hello World'); // Doesn't work
</cfscript>
<cfargument name="bar" required="false" />
<cfreturn true />
</cffunction>
<cfscript>
foo('Hello World'); // Works
foo(bar = 'Hello World'); // Works
variables.foo('Hello World'); // Works
variables.foo(bar = 'Hello World'); // Doesn't work
</cfscript>
Explanation
Named arguments aren't allowed for user defined functions if you reference it by the scope it's in or if you copied it into a structure or array.
Although CFC's called with the same syntax do allow named arguments. cfcFunc.foo(bar = 'Hello World') works.
Although CFC's called with the same syntax do allow named arguments. cfcFunc.foo(bar = 'Hello World') works.
Submitted on Tuesday 7 October 2008

Posted by Adrian Lynch on Tuesday 7 October 2008
Posted by David Boyer on Wednesday 8 October 2008
Posted by Adrian Lynch on Wednesday 8 October 2008
VARIABLES.myFunction = REQUEST.myFunction;
myFunction(name="cferror.org rocks a fat one");
I wonder if that works.