You need to sign in to do that
Don't have an account?

Custom Button Not Working
Greetings!
I have an extremely simple Salesforce app I've created for a non-profit. For one of my custom objects, called Donation, I created a custom button called 'Receipt' that runs Visual Force code to create a PDF that renders in a separate window. This VF code runs perfectly fine in my development account (a DE). However, when I create a package of my app and install it on another DE, that the non-profit will be using, this VF code for this button does not work. Instead, I get the following error message:
Visualforce Error
common.apex.runtime.impl.ExecutionException: SObject row was retrieved via SOQL without querying the requested field: srdforce__Donation__c.srdforce__Check_No__c
Here is the VF code for button 'Receipt':
<apex:page standardController="srdforce__Donation__c" showHeader="FALSE" standardStylesheets="false" renderas="pdf"> {! IF(ISBLANK(Donation__c.Check_No__c), "PLEASE ENTER Check Number BEFORE PRINTING RECEIPT", "")} <center> <hr style="color: 'black'; height: '1'; text-align: 'center'; width: '50%'"/> Indo-American Cultural & Religious Foundation<br/> P.O. Box 35275 Phoenix AZ 85069<br/> Tax ID: 86-0620445 A non-profit organization - IRS Section 501(c)(3)<br/><br/> <strong style="font-size:20px">IACRF Donation Receipt</strong> <hr style="color: 'black'; height: '1'; text-align: 'center'; width: '50%'"/> <strong>Receipt No:</strong> {!Donation__c.Receipt_Number__c} <strong>Donation Amount:</strong> <apex:outputField value="{!srdforce__Donation__c.srdforce__Donation_Amount__c}"/> <strong>Check No:</strong> {!Donation__c.Check_No__c} <strong>Date:</strong> <apex:outputText value="{!MONTH(TODAY())}"/>/<apex:outputText value="{!DAY(TODAY())}"/>/<apex:outputText value="{!YEAR(TODAY())}"/> </center> <br/> <!-- Show Mailing Address --> {!Donation__c.Donor__r.First_Name__c} {!Donation__c.Donor__r.Last_Name__c}<br/> {!Donation__c.Donor__r.Address__c}<br/> {!Donation__c.Donor__r.City__c}, {!Donation__c.Donor__r.State__c} {!Donation__c.Donor__r.Postal_Code__c}<br/> <br/><br/><br/><br/><br/> Received above donation on <strong><apex:outputField value="{!srdforce__Donation__c.srdforce__Date__c}"/></strong><br/><br/> The Foundation and Bharatiya EKTA Mandir appreciate your loyalty and support, and gratefully acknowledge your generous donation.<br/><br/><br/> Thank you, <br/><br/><br/><br/><br/><br/> Lalit Patel <br/> Treasurer <br/> IACRF/Bharatiya EKTA Mandir <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/> <center> No goods or services were provided as a part your donation.<br/> NOTE: Your contribution is tax deductible to the extent permitted by the IRS.<br/> Please consult your tax advisor. </center> </apex:page>
Any help or suggestion for debugging this is welcome!
Regards,
Sangita
This means that the field srdforce__Check_No__c is missing.
Check is the field srdforce__Donation__c exists in the custom object in the destination org.
srdforce__Donation__c does exist in my destination org, as does srdforce__Check_No__c.
As for controllers (you asked this in the email that got sent to me) I am using the standard controller for srdforce__Donation__c. If this is an incorrect implementation, please let me know. Otherwise, how would I update the controller for this custom object?
Thanks!
Can you plz try creating an extension for this controller ,from that controller query the srdforce__Donation__c object(along with the related fields) and using setter/getter try to display/update the value.
Try replacing {!Donation__c.Check_No__c} in with srdforce__Donation__c.srdforce__Check_No__c
Hello,
I tried your suggestion and that did not work. I got the following error after making this change and clicking 'Save':
Error: Unknown property 'srdforce__Donation__cStandardController.Donation__c'