1

All of a sudden our styles on Visualforce pages are not applying. This is not happening in every org and only seems to be in the CS instances. I was viewing these vf pages today and did not have these issues. No changes were made to the pages since then. Is anyone else experiencing similar issues?

I know this isn't a lot to go off of but this is exactly what is happening. Just trying to see if this is happening to anyone else.

12
  • 1
    Has your sandbox gone Winter '24?
    – Nick C
    Commented Aug 23, 2023 at 6:13
  • 1
    Or have you been moved to Hyperforce, perhaps? Also, how are you defining the styles? As style properties or using CSS?
    – Phil W
    Commented Aug 23, 2023 at 8:00
  • 1
    Facing the same issue with Scratch orgs and all Sandboxes apart from production. No Hyperforce (as far as I can tell, Assistant tells me that Migration is coming soon) and no Winter Release, just the PDFs not rendering as they did a few days ago. Can't contribute to a solution right now but can confirm it's not an individual topic.
    – dschib
    Commented Aug 23, 2023 at 13:30
  • 1
    There are styling hooks that have to be mentioned as part of the <style> tag, such as header and footer positioning. These things don't work just as any other styling has ceased to work. It really seems like a big malfunction of Flying Saucer. A case has been raised already
    – dschib
    Commented Aug 23, 2023 at 13:58
  • 1
    I have a call with them at 130 Commented Aug 23, 2023 at 14:56

3 Answers 3

5

There is an active incident now that looks like it could be related. I'm waiting for the rollback to see if that resolves it.

https://status.salesforce.com/generalmessages/1171

Update: This is related and the rollback fixes all of my VF pages without any changes on my end.

Update2: Salesforce support reached out and confirmed my issue was related to this current issue. Although the workaround showHeader="false" applyHtmlTag="false" solves the issue this is only a workaround with the current bad patch and once they resolve the issues on their end this will not be required

Update3: We still have customers experiencing this issue on hyperforce instances. Namely USA418 which is on Summer '23 Patch 18.1. Hopefully they will be rolling those back as well.

2

Adding showHeader="false" applyHtmlTag="false" apparently makes this work on scratch orgs again. I cannot explain why Salesforce seems to treat the same markup differently on the different orgs currently, but this adjustment also saved the PDF we originally saw this problem with.

showHeader has to be added when using applyHtmlTag but applyHtmlTag is the setting that actually fixes things.

5
  • Thank you! I have this issue on production orgs. Yes - this works. Previously i already have showHeader="false", standardStylesheets="false", applyBodyTag="false" added and issue appears, but adding the applyHtmlTag="false" solved it Commented Aug 24, 2023 at 8:22
  • showHeader="false" is the minimum amount of additonal info you have to give when using applyHtmlTag="false", which is why I added this.
    – dschib
    Commented Aug 24, 2023 at 11:37
  • On our own production instance, it did actually also come up today while yesterday my testing still had everything intact. Seems like we got to the latest patch too.
    – dschib
    Commented Aug 24, 2023 at 11:44
  • It sadly doesn't explain though why it all of a sudden stopped working or why it works in some instances. I'm hoping SF can still help out as fixing all of our VF pages will be a large maintenance undertaking Commented Aug 24, 2023 at 11:44
  • 1
    The active incident you linked does explain it pretty well now. The explanation is not complete (as formatting in general didn't get parsed) but I digress.
    – dschib
    Commented Aug 24, 2023 at 12:52
1

I was able to confirm that Production and Scratch Orgs / Sandboxes for us bear differences with the exact same markup

<apex:page renderAs="pdf" applyBodyTag="false" >
        <head>
                <style type="text/css" media="print">
                      @page {
                               @top-center {
                                       content: element(header);
                               }
                               @bottom-left {
                                     content: element(footer);
                               }
                      }
                      div.header {
                               padding: 10px;
                               position: running(header);
                      }
                      div.footer {
                               display: block;
                               padding: 5px;
                               position: running(footer);
                      }
                      .pagenumber:before {
                               content: counter(page);
                      }
                      .pagecount:before {
                               content: counter(pages);
                      }
                        
                      div.content{
                               font-family: Arial Unicode MS;
                      }
                    </style>
              </head>
           <div class="header">
              <div>Account name doesnt matter ----------- and the date is {!TODAY()}</div>
           </div>
           <div class="footer">
                <div>Page <span class="pagenumber"/> of <span class="pagecount"/></div>
          </div>
          <div class="content">
               <p>Actual page body information.</p>
          </div>
</apex:page>

This looks different between Scratch Org and Production.

markup rendered on production This is what it looks like on Prod.

markup rendered on scratch org

This is what it looks like on our Scratch Org

This definitely warrants investigation.

3
  • Thank you for sharing. I will reference this in my call with support Commented Aug 23, 2023 at 15:30
  • If you add applyHtmlTag="false" to you VF page does it work? Commented Aug 23, 2023 at 18:08
  • As a matter of fact it does. It's strange that this seems to be functioning differently on different patch versions.
    – dschib
    Commented Aug 24, 2023 at 6:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .