return type is not of specified return type.... so how do you return a null
My problem seems to stem from when no results are returned, I would like to return the same object type but as a null or so I think that's what I would like to do. If someone could please shed some light on how I should return an object with null I would be most appreciative.
I would like to note I have already tried returning entityNew("someObj") and that also resulted in failure.
<!---- get some object ---->
<cffunction name="getSomeObject" returntype="someObj" access="remote" >
<cfargument name="client_key" required="true" type="string" >
<cfargument name="customer_id" type="string" required="true" />
<cfscript>
value = [];
value = entityload(" some_table",{client_key = "#client_key#",customer_id = "#customer_id#"});
if(arraylen(value) == 1)
{
return value[1];
}
return;
</cfscript>
</cffunction>
</cfcomponent>
thank you in advance!
