We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now


New employee

psenn asked
Medium Priority
Last Modified: 2013-12-24
We have a new employee, and he has a reasonable request.
If he sees a field in a ColdFusion page, he wants to know where else that field is referenced, and hopefully where it's being updated or deleted.
What technique (tools) do you use other than doing a text search through all the cfm pages?
This is especially necessary for fields that have common names - field names like "Description".
And also for fields that are passed as arguments to functions, where their names could change.
Watch Question

there isn't really a tool I use, most of the form names I use in forms are uniquely named for that form, and you wouldn't see many different places where a single form name would be used becuase I just reuse the same template/view(for MVC) where I need it.

I'm not sure how everything is structured with your site, but the best way would be to follow the request up the chain, there isn't any tools I'm aware of or have seen in 7 years of development being used by developers for this purpose.

That's not saying there isn't, there might be, but I don't believe that's common and I haven't seen it or heard of it...
I know that's not the answer you were looking for, but I just wanted to add my input, perhaps someone may have used a tool that does what you're looking for, if not it's a good one to add to productivity tools if you can build it...



Yeah, something I thought of on the drive home was a "Code Explorer" where you input the page you want to "Explore" and it scans the ColdFusion source code for table and field names.
The following fields are referenced in myPage.cfm:
I've written scripts to parse an entire page which will return various things from the HTML, you could specify all form tags, inputs, selects, images, links, etc... One idea that may be helpful is creating a CFC package, and what would be in this package is different classes for instance a class for CSS, for javascript, CF, HTML, XML, etc... then inside each of those classes/cfc's you have methods/functions which will be something like for example in the HTML class, getFormElements(), getImageElements(), getTableElements(), etc... then a couple arguments you could pass to each is the file name/path, specific element you're searching for, etc... This way you could create a type of admin screen which you could list several checkboxes, radio, or selects which would run one of these components and return exactly what you're looking for. It'll take a bit to create the admin tool, but the end result could be close to what you're looking for, you may be able to get away with doing a batch search as well.... inside each of those methods would be a series of regex's which would parse the page specified for the elements your looking for, and this could get as detailed as the <input> names....


Uh huh.
Perhaps a simplistic approach would be to
a. Make a list of all the tables used in the page
b. Make a list of all the fields names in each of the tables used in the page.
c. Do a simple search within the page for those field names.

Trying to figure out if the field belongs to TableA or TableB might be too difficult.
1. <cfoutput name="TableAQry" query="TableA">#Field1#</cfoutput>
2. TableAQry.Field1
3. <cfset TableAQry=TableAObj.View1()>
4. <cfinvoke...>
5. etc, etc.
Lets say you want to parse a page which has two forms, formA and formB.... in each of those forms you have various fields and you want to list all fields in their respective forms....

1) parse the page for forms and store the results in an array....
    FormsArray (2-dimensions)
       [1][1] = FormA
       [1][2] = All Form A Content
       [2][1] = FormB
       [2][2] = All Form B Content
2) loop over the FormsArray and now parse for field names in FormsArray[x][2] creating a list of found field names and store in a second array...
    FieldsArray (2-dimensions)
      [1][1] = FormA
      [1][2] = Field Names List (fieldOne,fieldTwo, etc...)
      [2][1] = FormB
      [2][2] = Field Names List (fieldOne,fieldTwo, etc...)
3) If you want to keep it to one array, this is possible too, you just parse the Form Content before it gets stored to FormsArray[x][2] and create the list there...

I think this would be the most simplistic approach keeping it dynamic, however this still doesn't allow you to see what other views/templates are associated with the one you parse, the only way would be to grab the forms action attribute and then continue on down the line of parsing that associated page, but when it comes to pages with javascript and multiple forms you may start getting pretty complicated with the parsing, anything really is possible, but it'll get difficult very quick when you want to start following the flow and indentifying everything.
I would just use DreamWeaver's Find function and set it to search the entire project. It will create a list of all pages and locations of matches, and clicking on the items in the list will open the file and navigate to the referenced code.

So, for example, if you wanted to see everywhere the field "CustomerID" is used in your project, just seach for CustomerID.

Or am I missing your point?



Doing a simple search won't tell you how the variable is being used.
I'm afraid my conclusion is that there's no easy way to get this done.
I'm going to have to manually go through and document which cfm pages update which fields.
I'll probably have a page like TableA.cfm, which lists the fields in TableA and pulls in an associated Help text.
Then there should be a hypertext list of cfm pages that use this field.  
So if the field were Table.Desc, then the list will look something like:
SELECT: Page1.cfm, Page2.cfm
UPDATE: Page3.cfm
DELETE: Page3.cfm

So if you click on the hyperlink, it will take you to a html file, with a named anchor to the first occurance of where that field is being used.
Seems like a lot of work, but the hard part is fleshing out how to document a large project.
Once the creative part is done, the rest will be sort of rote.
The key to making it easy to follow all the elements in your site is having a solid framework in place, this way you don't have to track each form variable in your pages. You know how everything works based on the framework. For a new developer it should then be easy enough to have a couple days to get familiar with the framework in place and the business logic behind it. For junior developers a bit longer. If they still have trouble then its time to question the developer as they should be familiar with how everything works as far as application flow, with the business logic, well it takes a while to get use to in any company so time taken there for familiarity should be very understandable. I have never seen in any of the companies I've worked for a tool to find a specific occurance of a variable. With many of the companies they ran several sites so this task would consume an enormous amount of time as well as once in place wouldn't be used much. So it'd be a bit of wasted time.

I have worked with known frameworks such as Model Glue and Fusebox, as well as custom frameworks which combine ideas from several frameworks like the one I currently work with being a custom cocktail of Model-Glue, Mach II, and Fusebox. And in using these I've never had a problem finding a variable I was looking for because you can narrow it down very quickly with the framework in place. You can parse each page in your site for variables, form elements, etc... and store this in a table on a database to search, however with any new developments to the site, it may prove to be quite a task to keep everyone updating the database. So consider the impact with keeping the information current as well.


Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts


I agree with your assessment of the situation, but I was really hoping to find some sort of tool.
Jeff Peters talks about Fuseminder in the latest issue of cfdj, but that presupposes I'm using fusedocs.

I'll close this question out.
Thanks everyone.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.