Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
quote:
Originally posted by: Newsgroup User
I am attempting to pass an argument to a cfc to get the results back to the
calling page and am a wee bit confused.
Here is my <cfobject>:
<cfobject name="EditProject" component="sf_main.components.SingleProjects">
<cfset myProject = EditProject.GetProject(project_id=#URL.project_id#)>
I am attempting to pass the argument project_id to the cfc:
<cffunction name="GetProject" access="remote" returntype="query">
<cfargument name="project_id" type="numeric" required="true">
<cfquery name="projects" datasource="#Request.MainDSN#">
SELECT p.title, p.summary, p.duedate, c.company
FROM project P LEFT OUTER JOIN client C ON p.client=c.username
Where project_id=#argument.project_id# AND dirname='#Session.MM_Username#'
</cfquery>
<cfreturn projects>
</cffunction>
I keep getting and error saying that the argument "project_id" is undefined.
What do I have to change on what to get it to pass correctly?
Also, how do I pass multiple arguments to a cfc using this method?
Thanks! I am just learning how to create and use CFCs, so bear with me. :-)
--
Wally Kolcz
Developer / Support
Copy link to clipboard
Copied