Thanks, I have now moved all of my UDF's into a library file which is included in a global settings file. I have also written the UDF properly using the var prefix.

Cheers for all the help.

Dave

At 22:07 2/3/2003 +0000, you wrote:
There was a problem with including UDF's in the application.cfm, I
believe the functions get scoped or something, so you need to put them
in a global scope such as request to make them available to all
templates.


Russ Michaels
Macromedia/Allaire Certified ColdFusion Developer

Satachi Internet Development
Unit 2, 7A Plough Yard
London EC2A 3LP

Phone: 0870 787 3610
Tech Support: 0906 9607800
FAX: 0709 2212 636
http://www.satachi.com
email general: [EMAIL PROTECTED]
email support: [EMAIL PROTECTED]

Join our ColdFusion Developer discussion lists.
Send an e-mail to [EMAIL PROTECTED]


> -----Original Message-----
> From: David Phipps [mailto:[EMAIL PROTECTED]]
> Sent: 03 February 2003 15:30
> To: [EMAIL PROTECTED]
> Subject: [ cf-dev ] UDF problem
>
>
> Hi,
>
> I have a page that is running two update queries and both
> make use of a UDF
> which is cfincluded in the Application.cfm
>
> The first query uses the function and updates the db with no
> problem but
> the second call to the function thrwows the following error:
>
> Error Diagnostic Information
>
> An error occurred while evaluating the expression:
>
>
> "#fixedDate(attributes.webDate)#"
>
> Error near line 56, column 95.
>
> The symbol you have provided (fixedDate) is not the name of a
> function...
>
> Why am I able to call the function the first time and then
> not a second time?
>
> Is this a bug with UDF's?
>
> The two queries look like:
>
> This one works:
>
> <cfquery name="updateReleaseManagerPress" datasource="#request.dsn#"
> dbtype="ODBC">
>                  UPDATE releaseManager
>                  SET releaseDate = <cfif
> attributes.immediateRelease EQ 1
> AND attributes.isReleased NEQ 1><cfqueryparam cfsqltype="CF_SQL_DATE"
> value="#Now()#"><cfelse><cfqueryparam cfsqltype="CF_SQL_DATE"
> value="#fixedDate(attributes.releaseDate)#"></cfif>,
>                                  releaseTime = <cfqueryparam
> cfsqltype="CF_SQL_TIME" value="#attributes.releaseTime#">,
>                                  immediateRelease =
> #attributes.immediateRelease#,
>                                  releasedBy =
> '#session.currentuser.realname#',
>                                  processedDate = <cfqueryparam
> cfsqltype="CF_SQL_DATE" value="#Now()#">,
>                                  isReleased = 1
>                  WHERE releaseid = '#attributes.releaseid#' </cfquery>
>
> This throws the error:
>
> <cfquery name="updateReleaseManagerWeb" datasource="#request.dsn#"
> dbtype="ODBC">
>          UPDATE releaseManager
>          SET webRelease = #attributes.webRelease#,
>                          webDate = <cfif attributes.webDate IS NOT
> ""><cfqueryparam cfsqltype="CF_SQL_DATE"
> value="#fixedDate(attributes.webDate)#"><cfelse><cfqueryparam
> cfsqltype="CF_SQL_DATE" value="#Now()#"></cfif>
>          WHERE releaseid = '#attributes.releaseid#'
>   </cfquery>
>
> attributes.releaseDate = 03/02/03
> attributes.webDate = 3/2/2003
>
>
>
>
> Thanks
>
> Dave
>
>
> --
> ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED] For human help, e-mail:
> [EMAIL PROTECTED]
>
>



--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

============================================
Phipps CF Development
Oxford, Oxfordshire.
Telephone: +44(0)7718 896696
http://www.phipps-cf.co.uk
============================================


--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to