0

My HTML table components are missing in my production environment. Is there anything I have to do to make these visible? Everything is visible and working in sandbox.

Sandbox

enter image description here

Production

enter image description here

  • 1
    If your static resources were not deployed to Prod you will have an issue. Prod will not see Sandbox's static resources; they either need to be hosted publicly on the internet or promoted to Prod for the page to see. – zainogj Jan 12 '16 at 22:44
4

You may have answered your own question here. When you deploy anything from Sandbox to Production, you need to include everything, including your static resources.

If you've not included them in your change set, it won't work.

When you do deploy static resources, the good news is that the URL referencing that resource won't change.

Personally I find it good practice that at the start of any project I create a change set which continually gets added with whatever i create: classes, fields, folders etc...

Edit With respect to your problems with using HTML tables within <apex:repeat and a brief clarification in the comments, I'm guessing you've got something like this:

<table>
    <thead>
        <tr>
            <td>Id</td>
            <td>FirstName</td>
            <td>LastName</td>
        </tr>
    </thead>
    <tbody>
        <apex:repeat value="{!contact}" var="i">
            <td>{!i.Id}</td>
            <td>{!i.FirstName}</td>
            <td>{!i.LastName}</td>
        </apexL:repeat>
    </tbody>
</table>

I recall Salesforce has a massive issue with using standard HTML tables and I remember not being able to find much in the way of resources on this. I think it had something to do with the way Salesforce processes renders <table> and it's children. What is strange is that you've managed to get it working in the sandbox as this was something I couldn't do.

Possibly this might be because of differences in API versions? But I'm speculating.

It may well depend on your reasons for wanting to use HTML tables. For me, I wanted to not use standard stylesheets and use Bootstrap instead. The only workaround I could find for this was literally to just use "standard Salesforce tables":

<apex:pageBlock>
  <apex:pageBlockTable value="{!contacts}" var="i">
    <apex:column value="{!i.Id}" />
    <apex:column value="{!i.FirstName}" />
    <apex:column value="{!i.LastName}" />
  </apex:pageBlockTable>
</apex:pageBlock>

And, within <apex:page> use standardStylesheets="false".

Might not be what you were looking for, but I had exactly the same problem and this was the only workaround I could find.

  • Do you have any idea about the HTML tables not appearing? – Alex Brigham Jan 12 '16 at 23:01
  • @AlexBingham may be worth sharing your code on that one if it is coded and not the result of a static resource? – Dan Jones Jan 12 '16 at 23:14
  • I am missing some static resources in the page, but I'm now realizing that the main problem is that non-managed HTML elements within my <apex:form> tags are not loading. Neither is the CSS... The code is long and I don't want to overwhelm people. But just know that unmanaged HTML and CSS is not displaying in production, where it did in Sandbox – Alex Brigham Jan 12 '16 at 23:17
  • One suggestion: make sure you're not using /resource/myresource/path method of referencing resources. This can cause missed references. Instead, prefer using {!URLFOR($Resource.myresource,'path')}; if they're missing from the change set, salesforce will complain about the missing files. – sfdcfox Jan 13 '16 at 4:54
  • 1
    Thanks @Poet you've been a huge help. I will be looking back at the code today to see if there is anything else I can do as a workaround... otherwise I'll have to make the switch. I'll let you know if I find anything! – Alex Brigham Jan 13 '16 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.