Skip to main content
Inspiring
August 6, 2007
Question

CFC not changing

  • August 6, 2007
  • 3 replies
  • 905 views
I have an inherited program that has a CFC that was setup with the wrong ReturnType. So I changed the Returntype but the application doesn't seem to be recognizing the change. I even made some junky errors in the CFC to see if I was doing something wrong but it doesn't recognize those changes either. so obviously it isn't calling the CFC again. I am VERY new to using CFCs so I am not sure what I need to do to force the app to reinitialize or call the CFC again. Any help would be greatly appreciated. Under a bit of a time crunch 🙂
This topic has been closed for replies.

3 replies

Inspiring
August 6, 2007
In article <f97ild$jqn$1@forums.macromedia.com> "hml398"
<hlukes@digital-wise.com> wrote:
> I have an inherited program that has a CFC that was setup with the
> wrong ReturnType. So I changed the Returntype but the application
> doesn't seem to be recognizing the change.

Is the CFC in application scope? If so, you need to tell the
application to reinitialize (which will depend on the application -
but most applications that store data in application scope provide
some way of forcing a reinitialization).

Sean A Corfield
An Architect's View -- http://corfield.org/


--
I'm using an evaluation license of nemo since 61 days.
You should really try it!
http://www.malcom-mac.com/nemo

Inspiring
August 6, 2007
Check that you call right directory where your cfc is located and that changes placed on right cfserver.
Inspiring
August 6, 2007
Perhaps the problem is with the template calling the cfc and not the cfc itself.
hml398Author
Inspiring
August 6, 2007
This is the error message I get back:

The value returned from function getThreadIdFromMessageId() is not of type struct.

This is the calling code: <cfset application.user.subscribe(request.user.username, application.thread.getThreadIdFromMessageId(msgid))>

This is the function in the .cfm

<cffunction name="getThreadIdFromMessageId" access="public" returnType="string" output="false"
hint="Returns thread ID based on a message ID">
<cfargument name="id" type="uuid" required="true">
<cfset var qGetThread = "">

<cfquery name="qGetThread" datasource="#variables.dsn#">
select A.threadidfk
from #variables.tableprefix#messages A
where A.id = <cfqueryparam value="#arguments.id#" cfsqltype="CF_SQL_VARCHAR" maxlength="35">
</cfquery>

<!--- Throw if invalid id passed --->
<cfif not qGetThread.recordCount>
<cfset variables.utils.throw("ThreadCFC","Invalid message ID")>
</cfif>

<cfreturn qGetThread.threadidfk>

</cffunction>

Inspiring
August 10, 2007
quote:

Originally posted by: hml398
This is the error message I get back:

The value returned from function getThreadIdFromMessageId() is not of type struct.

This is the calling code: <cfset application.user.subscribe(request.user.username, application.thread.getThreadIdFromMessageId(msgid))>

This is the function in the .cfm

<cffunction name="getThreadIdFromMessageId" access="public" returnType="string" output="false"
hint="Returns thread ID based on a message ID">
<cfargument name="id" type="uuid" required="true">
<cfset var qGetThread = "">

<cfquery name="qGetThread" datasource="#variables.dsn#">
select A.threadidfk
from #variables.tableprefix#messages A
where A.id = <cfqueryparam value="#arguments.id#" cfsqltype="CF_SQL_VARCHAR" maxlength="35">
</cfquery>

<!--- Throw if invalid id passed --->
<cfif not qGetThread.recordCount>
<cfset variables.utils.throw("ThreadCFC","Invalid message ID")>
</cfif>

<cfreturn qGetThread.threadidfk>

</cffunction>



First, there is no indication that you are calling the function in the cfc. In fact there is no indication that you have a cfc. Is there a typo on this line?
This is the function in the .cfm

Next, your cffunction tag says that it returns a string. If your query returns more than one row, this could be a problem. An easy way to solve that is to specify the row number in your cfreturn tag.

Finally, your cfset tag should probably have an equal sign in it somewhere.