function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
whatAmIdoingwhatAmIdoing 

Redirect prevents system.debug messages from appearing

If I comment out "return casePage;" then my debugging messages appear in my System Log, but if uncommented the page redirects and no messages appear.  Why would this be?

Thanks.

 

           if(myModelID != NULL && parentcase != NULL) {
                System.debug('if all is well');
                for (String i : myModelID) {
             
                        System.debug(i);
                        System.debug(parentcase);
                       
                }

 

                PageReference casePage = new PageReference('/' + parentcase);
                casePage.setRedirect(true);

                return casePage;

           }

Message Edited by whatAmIdoing on 11-24-2009 12:31 PM
prageethprageeth

Hello whatAreYoudoing;

Since you use the "setRedirect(true);"  method you gets two debug logs at once. For the page where you invoke the action and for the page you are redirected to(In your case this is the page "casePage").

Sometimes you may be looking at the wrong log line. As I think in your case the relevant log line should be the line before the last line.

Please look at the "Operation" column in the debug log and find the relevant line.   

Message Edited by prageeth on 11-24-2009 07:53 PM