Question
return query from one CFC to another CFC
I have a CFC called "order.cfc". Also in this app is a CFC
called "user.cfc".
In my order.cfc, one of the functions will setup and create a new order for an existing user. The user ID is passed to the function "createOrder" in order.cfc.
Instead of duplicating a function called "getUser" from user.cfc, I figured I could pass the arguments.userID from order.cfc over to the getUser function of user.cfc and get my query result back:
<cfset thisCustomer = createObject("component","user").getUser(arguments.userID) />
Obviously, I'm doing something wrong as I keep getting this error message:
The value returned from function getUser() is not of type query.
However, getUser does return a proper query data type when I access that component directly and not from this other cfc.
In my order.cfc, one of the functions will setup and create a new order for an existing user. The user ID is passed to the function "createOrder" in order.cfc.
Instead of duplicating a function called "getUser" from user.cfc, I figured I could pass the arguments.userID from order.cfc over to the getUser function of user.cfc and get my query result back:
<cfset thisCustomer = createObject("component","user").getUser(arguments.userID) />
Obviously, I'm doing something wrong as I keep getting this error message:
The value returned from function getUser() is not of type query.
However, getUser does return a proper query data type when I access that component directly and not from this other cfc.
