For reasons I cannot entirely explain, I was trying to call dynamic methods in a cfc in cfscript. (The cfc code was calling a method within itself) I tested a few syntactically wrong ways of getting it done. It the underlying fact that functions are another type of variable in ColdFusion hit me. I should be able to assign dynamic variable to a new variable, and call that as a function. It worked.
functionName = “test”;
args.input = “Yo!”;
tempfunc = variables[functionName];
output = tempfunc(argumentCollection = args);
I feel like someone must have done this before, but could find nothing on it. So I figured I would blog it.