Can't get setNextEvent() to work


See this totally stripped down function in a cfc called Administration.cfc:

function test(event, rc, prc) {

If I call index.cfm/Administration/test I get a Missing Include error:

Could not find the included template [path]/administration/test.cfm.”

It’s clearly looking for the ‘default’ view, but I don’t want that view, I want to relocate.
What have I missed? Something in the config?


Try this

function test(event, rc, prc) {

Sorry, forgot to mention [ColdBox 3.6.0]

Hi Sana

Same error.

Hi Michael Casey,

Please reload framework and try… unless you are doing something else ?

also try this example

function test(event, rc, prc) {

Hi Sana

Reloaded framework.Tried new suggestion.
Same error.


I’m still having trouble with this. Presumably it must be a configuration issue(?)


Just for testing
Use cflocation instead of setNextEvent

Yes, cflocation works fine. Eg:

location("#event.buildLink(“Administration.locations”)#", false);

But ColdBox documentation insists that I use setNextEvent()…

Here’s the reference for event handler (

setNextEvent(event=“Administration.locations”); Use dot instead of slash.
setNextEvent(url=“”); Use absolute URL.

Hope that helps.

Hi Ancient

Using dots instead of slashes is generating the same error (for me).

What exactly the error message when you tried with dot?
Also check your Coldbox.cfc - handlersExternalLocation, perhaps the handler is not in the default location.

Hi Ancient

The same error as reported above:Error Type: MissingInclude : [N/A]

Error Messages: Could not find the included template [path]/views/administration/test.cfm.

I have this setting in Coldbox.cfc:
handlersExternalLocation = “”,

Hi all

This still isn’t working for me. Should I maybe post the config file? Anybody got any suggestions?

Not sure what’s going on. Based on your sample code, this is how should work:

function test(event, rc, prc) {
setNextEvent(event=“Administration**.**locations”); // Use dot, not slash

If you call index.cfm?event=Administration.test from your browser, it will be redirected the page to Administration.locations. By default, implicitly the handler will call the view page, locations.cfm. If you don’t have locations.cfm in your /views/administration folder, then you will get Error Messages: Could not find the included template [path]/views/administration/locations.cfm.

Hi Ancient

Well yes, I agree with everything you say, that is what should happen. But it doesn’t :frowning:

To recap, the test() function runs and Coldbox, rather than executing setNextEvent() and relocating like it should, is immediately asking where the /views/Administration/test.cfm template is. And of course there isn’t one.

Note that if I use Sana’s suggestion of: location("#event.buildLink(“Administration.locations”)#", false); the application locates perfectly. Maybe that’s because the native CF function just kicks in and takes over where Coldbox is failing? It’s a guess, but I don’t know.

But I am assuming there must be something in my config that is preventing setNextEvent() from working, but what could it be??

OK, so first of all the setNextevent() method in ColdBox literally just does a cflocation. Here is the code from ColdBox 3.6.0:

If you’re seeing otherwise, you need to provide us with the full stack trace of the error. It will tell us right away where in the request lifecycle this is happening.
Secondly, can you create a sample application that exhibits this behavior that you can zip up and send for us to try?
Lastly, please consider staying up to date with ColdBox 4.1. ColdBox 3.6.0 is missing 2 years worth of enhancements and bug fixes.



ColdBox Platform Evangelist
Ortus Solutions, Corp

ColdBox Platform:

If it is using the default view, then you need to figure out why it is using the default view.

Is Administration a Module and if so check what layout it is using. But for future reference, the setNextEvent() has to be a valid handler that ColdBox understands, if it is not then it will try to load the default layout and view and in this case is probably the source of your issue.

Hi Andrew

Is Administration a Module…?
It’s just an ordinary controller in the \handlers directory.

the setNextEvent() has to be a valid handler that ColdBox understands…
It seems that Coldbox is currently simply ignoring setNextEvent(). For info, Coldbox is definitely ‘working’ at this point because runEvent() works if I substitute it in. So the question is, why is setNextEvent() apparently not “a valid handler that ColdBox understands”, and how can I make it so? Where do I look? And would it help if I posted the Coldbox.cfc?

Hi Brad

Full stack trace attached.

stack trace.txt (6.46 KB)