Are you running a form on the web and using this code? You must use WEB.SHOW_DOCUMENT() instead in this case.