I also just used the same trick, that is ns_conn isconnected
, to let me use the same page from either the website or a scheduled proc. At the top of my tcl page I use:
if {[ns_conn isconnected]} {
set order_id [ns_queryget order_id]
}
You could also probably surround ad_page_contract
as well. This makes it a lot easier to test template changes without waiting for the schedule proc to fire.