Find your content:

Search form

You are here

Visualforce error using standard controller in managed package

 
Share

I have an inline visualforce page which uses a standard controller. I check values from the record object in javascript so I can display some other records in a popup based on the value of customfield.

Inline VF Page:

<apex:page standardController="MyObject__c" showHeader="false">
<apex:form id="myForm">
                <input type="button" id="someBtn" onclick="showPopup()" title="Click Here"/>
</apex:form>
<script> 
var id = '{!MyObject__c.Id}';
var fieldValue = '{!MyObject__c.CustomField__c}';  

function showPopup(){
    checks fieldValue and does something...
}
</script>
</apex:page>

This works fine on developer org with no issues but when this is added to managed package, on the org where package is installed I see this visualforce error:

Content cannot be displayed: SObject row was retrieved via SOQL without querying the requested field: namespace_MyObject_c.namespace_CustomField_c

I am not using extension here so cannot figure out why this error. Any idea what I am missing?


Attribution to: Samruddhi Patil

Possible Suggestion/Solution #1

You need to include your organization namespace in the field which you mentioned in the java script {!Namespace_MyObject__c.Id}'; {!namesapce_MyObject__c.namesapce_CustomField__c}'


Attribution to: Karanraj
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/775

My Block Status

My Block Content