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
YallDevYallDev 

Apex page redirect, loads page without css style

Hi

 

I have waited a while before posting this issue, with the hope that I could have resolved it on my own, however without any success I must ask the guru's.

 

I am overiding a standard contact page, by checking the type of profile.  after all profiles have been checked the snippet below is called at the end of the redirect method.

 

 

 if(pageRef == null)
      {
          pageRef = ApexPages.currentPage();  
           
      }

 

This has worked before, but stopped working after the winter update at least its what I assume.

 I have already tried to create minimalistic pages with the least apex markup, but it still does not work. below is a screen shot of the contact page thats loaded after redirecting.

Any tips would be appreciated..

 

Thx

 

 

 

 

 

Best Answer chosen by Admin (Salesforce Developers) 
YallDevYallDev

Thanks for the reply.

 

I managed to get the page to load correctly.  Below is the snippet that I added. My page now loads fine with its css style.

 

 if(pageRef == null)
      {

           ApexPages.StandardController sc = new ApexPages.StandardController(sfContact);

            PageReference contactPage = sc.view();

            contactPage.setRedirect(true);

      }

 

Thx again

All Answers

Andrew WilkinsonAndrew Wilkinson

I ran into this issue and had to revert the page(s) to the previous api version. I was doing a redirect based on some criteria.

YallDevYallDev

Hi Andrew

 

Thanks for the reply,  I will look into the reverting the pages, how will this affect users if they are installing any packages

containing the pages ?

 

thx again

Regard

 

Jamil

Andrew WilkinsonAndrew Wilkinson

Well the package unless "repackaged" will contain the old metadata for API version. But changing the API in the org for the pages shouldn't affect too much. Unless you used something specific that could only be done in that API Version.

YallDevYallDev

Thanks for the reply.

 

I managed to get the page to load correctly.  Below is the snippet that I added. My page now loads fine with its css style.

 

 if(pageRef == null)
      {

           ApexPages.StandardController sc = new ApexPages.StandardController(sfContact);

            PageReference contactPage = sc.view();

            contactPage.setRedirect(true);

      }

 

Thx again

This was selected as the best answer