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 6861005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:28:49+00:00 2026-05-27T02:28:49+00:00

I am using ColdFusion 9.0.1. Let me start by stating that I may not

  • 0

I am using ColdFusion 9.0.1.

Let me start by stating that I may not be asking the right question. Since each function works independently and fails only when one function calls another, I am thinking that the problem is in how the function is called.

I am creating an application variable that contains a structure. The structure contains the reference to an object, orders.cfc.

if (not isDefined("APPLICATION.AppInfo") or not isStruct(APPLICATION.AppInfo)) {
    APPLICATION.AppInfo = structNew();
    APPLICATION.AppInfo.objOrders = createObject("component", "globaladmin.orders");
}

I am able to successfully access the methods in the orders.cfc like this:

OrderItemList = APPLICATION.AppInfo.objOrders.orderItemList(URL.Customer);

I have methods in the orders.cfc that call other methods in the order.cfc, kind of like this (faked for simplicity):

<cffunction name="orderItemList">
    <cfscript>
          LOCAL.RandomNumber = getRandomNumber();
          return LOCAL.RandomNumber;
    </cfscript>
</cffunction>

<cffunction name="getRandomNumber">
    <cfscript>
        LOCAL.SomeNumber= randRange(0,10);
        return LOCAL.SomeNumber;
    </cfscript>
</cffunction>

I get this error:

Entity has incorrect type for being called as a function. The symbol you provided getRandomNumber is not the name of a function.

I figured maybe I can’t reference a function within the same CFC without creating an object first, so I do this:

<cffunction name="orderItemList">
    <cfscript>
          LOCAL.RandomNumber = APPLICATION.AppInfo.objOrders.getRandomNumber();
          return LOCAL.RandomNumber;
    </cfscript>
</cffunction>

Then, I’d get this error:

Either there are no methods with the specified method name and argument types, or the method getRandomNumber is overloaded with arguments types that ColdFusion can't decipher reliably. If this is a Java object and you verified that the method exists, you may need to use the javacast function to reduce ambiguity.

How should I call a second function within the same CFC?

  • 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-27T02:28:49+00:00Added an answer on May 27, 2026 at 2:28 am

    The first thing I would try is var scoping your all your variables within your functions:

    <cffunction name="orderItemList">
        <cfscript>
              var RandomNumber = getRandomNumber();
              return RandomNumber;
        </cfscript>
    </cffunction>
    
    <cffunction name="getRandomNumber">
        <cfscript>
            var SomeNumber= randRange(0,10);
            return SomeNumber;
        </cfscript>
    </cffunction>
    

    If that doesn’t solve the problem, let me know and we can explore further.

    edit
    Okay, now that the local scope issue is resolved, try this:

    <cffunction name="orderItemList">
        <cfscript>
              LOCAL.RandomNumber = THIS.getRandomNumber();
              return LOCAL.RandomNumber;
        </cfscript>
    </cffunction>
    
    <cffunction name="getRandomNumber">
        <cfscript>
            LOCAL.SomeNumber= randRange(0,10);
            return LOCAL.SomeNumber;
        </cfscript>
    </cffunction>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using ColdFusion to populate a template that includes HTML unordered lists ( <ul>
Using ColdFusion 9.01, occasionally, we have observed an issue where an error may be
I am using ColdFusion 9.0.1 and some database that I cannot change. I am
I'm using ColdFusion to return a result set from a SQL database and turn
We are using ColdFusion MX7. The CFDOCUMENT tag uses iText for the PDF creation
I'm using coldfusion 9 and I'm trying to grab a file from an ftp
I want to make an FTP connection (ideally using Coldfusion 8, but Java is
Using CFML (ColdFusion Markup Langauge, aka ColdFusion), how can you compare if two single
I'm trying to create pagination for search results using MySQL and ColdFusion. My intention
How to print all the result without using Results.columnname in ColdFusion for ex:- I

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.