We have a domain that is accessible once logged in to Salesforce, that we use to view VisualForce pages, like


We also have a domain that has some publicly accessible pages, like


Apex code behaves differently depending on the domain.

So on the internal domain, this might render:

<apex:outputText rendered="{! !SomeObject.Some_Boolean_Field__c}">
   Some Boolean Field was false

Whereas on the external domain, it does not. It acts like the field has a different value. I have checked that the object and field are publicly accessible.


  • Hey, I don't think it would render it that way as the flag is based on the field data. Please check whether the external URL is also pointing to the same Salesforce instance as the internal one. Also, check if you are accessing the URLs for the same record. Try adding some debug statements in the APEX controller and check the field value at the back-end. – Prudhvi Konda Sep 19 '19 at 0:45
  • 3
    when u view using vf page , it's running under current user context but when u running on site it s running behalf of guest user... guest user may not have record access and field access – Ayub Sep 19 '19 at 1:04
  • @PrudhviKonda can you explain what you mean "the flag is based on the field data"? And following your advice I am logging various field values as debug statements. I can see now that some fields are coming through on the public domain, others are not, so I think this points to a user context / access issue as Ayub mentioned. – wrydere Sep 19 '19 at 18:00
  • @wrydere - Yeah, that's correct. Since the Boolean value is not being fetched due to access issues, it might be setting the default value to "false". What I meant with "the flag is based on the field data" was, the rendered logic to display or not is based on the data stored in a field and that data needs to be consistent at all times. – Prudhvi Konda Sep 19 '19 at 18:17

Your Answer

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

Browse other questions tagged or ask your own question.