Skip to main content
Participant
March 7, 2018
Answered

Coldfusion Newbie help-query related

  • March 7, 2018
  • 1 reply
  • 269 views

Sorry for the vague title, but ColdFusion is not something I understand well. I'm trying to replicate a Coldfusion report in ASP.net, but I'm at a lose of where the data is coming from. I've conferred with a few developers here and we believe its the below line (in bold). Thing is....I have no idea what 'cf_act_get_remaincourses' is or comes from. I've done a search through the entire site and find no other references to it. I don't see anything in the database with a similar name.

So, what is this object? (Its not a cf try, or cf it....)

Where can it possibly be pulling data from.

<cftry>

            <cf_act_get_remaincourses userid=#GetGroupStudents.userid# datacheck=#ODBC_DataSource#>

            <cfset Count = result>

            <td align="center">#val(Count)#</td> 

        <cfcatch type="any">

        <td><font color="##666666">Error</font></td>

</cfcatch>

    This topic has been closed for replies.
    Correct answer Dave Watts

    This is called a custom tag. Someone wrote a separate file, named it cf_act_get_remaincourses.cfm, and that file is being invoked by your file. You'll need to open the custom tag file up and see what it's doing. It will almost certainly have a CFQUERY tag within it. The point of this custom tag is simply to provide an additional layer of abstraction and potential reuse within the code.

    The custom tag may be in the same directory as your file, or it may be in a custom tags directory defined within the CF Administrator, or it may be in a custom tags directory defined within your Application.cfm or Application.cfc file which is generally in the root directory of your web application.

    Dave Watts, Fig Leaf Software

    1 reply

    Dave WattsCommunity ExpertCorrect answer
    Community Expert
    March 7, 2018

    This is called a custom tag. Someone wrote a separate file, named it cf_act_get_remaincourses.cfm, and that file is being invoked by your file. You'll need to open the custom tag file up and see what it's doing. It will almost certainly have a CFQUERY tag within it. The point of this custom tag is simply to provide an additional layer of abstraction and potential reuse within the code.

    The custom tag may be in the same directory as your file, or it may be in a custom tags directory defined within the CF Administrator, or it may be in a custom tags directory defined within your Application.cfm or Application.cfc file which is generally in the root directory of your web application.

    Dave Watts, Fig Leaf Software

    Dave Watts, Eidolon LLC
    Charlie Arehart
    Community Expert
    Community Expert
    March 7, 2018

    Just a small (but important) tweak to Dave's helpful answer (and Dave's a legend. You're just asking about something not used so much these days.) The file would actually be act_get_remaincourses.cfm (rather than cf_act_get_remaincourses.cfm).

    /Charlie (troubleshooter, carehart. org)
    Community Expert
    March 7, 2018

    Yeah, I mistyped. Charlie's right to point that out, as it's pretty important if you're trying to find a file. I think custom tags are still used pretty often actually, but not as much as they used to back in CF 5 and earlier.

    Basically, what's going on is that when you use a custom tag, you can prepend "<cf_" to the name of your file and CF will treat it as a custom tag. Whatever parameters you specified will be passed to the custom tag as variables that it can use. I'm oversimplifying quite a bit here, but it's enough for now.

    Dave Watts, Fig Leaf Software

    Dave Watts, Eidolon LLC