We have a custom Visualforce page that is within the Account page layout. This is working for several customers and we’ve never has a problem with it.
Today one of our customers has added new users to their Salesforce organisation and at first they could see the Visualforce page, but they “made some changes” and now none of the new users can see the Visualforce page. It is still working for the older users.
The new users see the following error in the JavaScript console:
document.forms.echoScontrolForm_xxx is undefined
We think there is some kind of config/permissions issue with the new users but at the moment we are unable to diagnose the issue.
For information here is the Visualforce markup (it just creates an IFrame to load our external app into the page):
<apex:page standardController="Account">
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js" />
<h1 style="font-size: 20px; color: #909090;">Loading...</h1>
<script type="text/javascript">
jQuery(document).ready(function() {
var orgId = '{!$Organization.Id}';
var accountId = '{!account.id}';
var url = 'https://' + orgId.substring(0, 15) + '.somesite.com/Account/' + accountId.substring(0, 15) + '?SessionID=' + encodeURIComponent('{!$Api.Session_ID}') + '&ServerURL=' + encodeURIComponent('{!$Api.Partner_Server_URL_200}');
$('body').empty().append($('<iframe />', { src: url, style: 'border: none; width: 100%; height: 300px;' }));
});
</script>
</apex:page>
Any pointers as to what is causing this would be very helpful!
Turns out that the customer had created a custom Visualforce page that contained the standard page layout which in turn contained our Visualforce control. Their custom Visualforce control had some issues that they didn’t disclose to us, but were causing execution of the to fail.
They resolved these issues and our VF control started working again.