On 3/8/06, João Fernandes <[EMAIL PROTECTED]> wrote:
> I'm trying to fill my record dynamically but setting something like this:
>
> <cfset funct = myRecord["set#myvar#"]>
> <cfset funct(myvalue)>
>
> I'm getting this
>
> Variable _getTo is undefined.

Correct. When you extract a method from a CFC like that, the call
executes in the context of *your* code, not the context of the CFC. In
other words it behaves just like a UDF. The name lookup in ColdFusion
is dynamic so when _getTo is looked up, it will happen in the context
of *your* code since the function is being executed outside the CFC!
That's not a Reactor issue.

Use <cfinvoke> to call a dynamic method:

<cfinvoke component="#MyRecord#" method="set#MyVar#">
    <cfinvokeargument name="#MyVar#" value="#myvalue#" />
</cfinvoke>
--
Sean A Corfield -- http://corfield.org/
Got frameworks?

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood



-- Reactor for ColdFusion Mailing List -- [email protected]
-- Archives at http://www.mail-archive.com/reactor%40doughughes.net/


Reply via email to