cfreturn variable is not recognized when outputing content
I have a page that i wish to display total invoices paid to a particular contractor. This Page is Runnign CF9. I'm using a CFC page to write my queries and a action page to display the output via a search box from a search page. Whenever i input the invoice id, coldfusion throws the error: Variable RECENT_INVOICE is undefined" Am i missing something? my syntax is written below:
<!---CFC PAGE--->
<cfcomponent>
<cffunction name="getinvoice" access="public" returntype="query">
<cfquery name="recent_invoice" datasource="w9">
SELECT invoice.*, project.*, bid.*, CONCAT(w9.w9fname,' ', w9.w9lname,' ', w9.w9businessname) AS Contractor, w9.*
FROM invoice, project, bid, w9
WHERE invid = #form.invid#
AND INVOICE.invcontractor = W9.w9ID
AND INVOICE.invproject = PROJECT.proID
AND INVOICE.invproject = BID.bidproject
AND INVOICE.invcontractor = BID.bidcontractor
</cfquery>
<cfreturn recent_invoice>
</cffunction>
</cfcomponent>
<!---Display page that show the invoked query--->
<cfinvoke
component="invoice.componets.test"
method="getinvoice"
returnvariable="recent_invoice">
<!--- CFC Query --->
</cfinvoke>
<!---OUTPUT Items Below--->
<cfoutput>#recent_invoice.invdate# - #recent_invoice.invjob1# - #recent_invoice.invamt1#</cfoutput>
