
1 risposta
According to the official documentation (https://help.salesforce.com/articleView?amp;language=en_US&id=000170999&type=1), this behavior is to be expected. "The error "SObject-row-was-retrieved-via-SOQL-without-querying-the-requested-field" can occur when accessing a Visualforce page with a standard controller and a custom controller extension. When a standard controller queries an object for a Visualforce page, it only retrieves the fields from the object that are referenced in the page.
This improves efficiency by not retrieving fields that are not needed by the Visualforce page.
When a custom controller references a field that is not included in the page, the field data is not available, and the error occurs. "
Make a change to your page like this
<apex:page standardController="Opportunity" extensions="PartnerPromotionBanner">
<marquee id="banner" rendered="{!Msgid}" style="box-shadow: 0px 0px 15px black; border-radius: 5px; padding: 10px; background-color: ⌗FF0000; font-weight: bolder; font-size: 16px; margin: 10px; color: ⌗FFFFFF font-family:'Lucida'">{!Promo}</marquee>
<apex:outputText label="invisible" value="{!Opportunity.Promotion_Code__c}" rendered="false"/>
</apex:page>