Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7404185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:13:12+00:00 2026-05-29T05:13:12+00:00

I am using ColdFusion 8.0.1 I am working on an existing application that has

  • 0

I am using ColdFusion 8.0.1

I am working on an existing application that has thousands of pages. I am trying to include a library of new UDFs in my application.cfm file.

I addedd this line to application.cfm:

<!--- UDF library include --->
<cfinclude template="UDF/udf_library.cfm">

The UDF library includes other files that contain UDFs, like this:

<cfinclude template="udf_powerreview.cfm">

I have functions in the udf_powerreview.cfm file, such as:

// CREATE POWER REVIEWS SNIPPET
function createPRSnippet(Page_ID) {
    LOCAL.Page_ID =  ARGUMENTS.Page_ID;
    if (isNumeric(LOCAL.Page_ID) && LOCAL.Page_ID > 0) {
        LOCAL.Snippet = "<div class='pr_snippet_product'><script type='text/javascript'>var pr_snippet_min_reviews = 0; POWERREVIEWS.display.snippet(document, { pr_page_id : '#LOCAL.Page_ID#' });</script></div>";
    } else {
        LOCAL.Snippet = "";
    }
    return LOCAL.Snippet;
}

The debugging tool says that UDF/udf_library.cfm and udf_powerreview.cfm are being successfully included.

The problem is when I call the function in another page, I get an error that says that function doesn’t exist. When I can copy the function and put it directly into the page that it is used in and it works just fine. And, I do not get the error “routines can not be declared twice”.

In every site that I build, I create a udf_library.cfm or udf_library.cfc in the exact same manner. They always work fine.

What might prevent the functions from being available and accessed? Is there an application setting that needs to be set?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T05:13:13+00:00Added an answer on May 29, 2026 at 5:13 am

    It’s a page scope issue. Don’t think of the Application.cfm as an include on all your pages, just know that it runs first. Somethings it initializes will carry over to your existing page scope and some things won’t. Using an Application.cfc instead of an application.cfm takes care of much of the ambiguity.

    To make your UDF’s available to your whole application, I would suggest using a “Singleton” Design pattern. First take your UDF’s and put them in a CFC format. This will make them more portable.

    in your application.cfm you could put the following lines:

    <cfif NOT isdefined('session.udf_powerreview') or isdefined('url.resetudf')>
      <cfset  session.udf_powerreview = createobject('Component','udf.udf_powerreview')/>
      <!--- this 'udf.udf_powerreview' represents the physical path udf/udf_powerreview.cfc --->
    </cfif>
    

    I’m stuffing it in the session scope instead of the application scope, becuase you won’t have an good way of resetting the application scope if you modify your UDF’s.

    Either way, once this is in your application.cfm you should be able to see your functions on any page.

    <cfdump var="#session.udf_powerreview#">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using ColdFusion 9.1.0. I am working on part of a site that
I'm working on a Fusebox application using Coldfusion, and there is a fusebox.xml file
I'm using ColdFusion to populate a template that includes HTML unordered lists ( <ul>
I'm using coldfusion 9 and I'm trying to grab a file from an ftp
I'm trying to create pagination for search results using MySQL and ColdFusion. My intention
I have a web application, written in ColdFusion, which periodically starts using 100% of
Given the nature of the project I'm working on, I'm trying to avoid using
I am using SASS and it has been working, but now I get this...
I am trying to access userdata I have sent from the server (using coldfusion)
I'm working on adding a new webapp to an existing website. I've been directed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.