• ani11
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 5
    Replies


I have three objects Opportunity, Payment Schedule and Proposal

Relationship between the objects
Opportunity is lookup to Payment Schedule and Proposal,,


 relation between PaymentSchedule and Proposal is look up
I want to show Payment Schedule field values in Proposal Visaualforce PDF page

Payment Schedule Fields:
Name and Percentage
How to call these values in Proposal Visualforce PDF

  • September 26, 2012
  • Like
  • 0

   Compile Error: Illegal assignment from System.PageReference to pagereference

 

attachementPDF Page <apex:page standardController="account" renderAs="PDF"> <c:attachment /> </apex:page> sendemail Page <apex:page controller="sendEmail"> <apex:messages /> <apex:pageBlock title="Send an Email to Your {!account.name} Representatives"> <p>Fill out the fields below to test how you might send an email to a user.</p> <br /> <apex:dataTable value="{!account.Contacts}" var="contact" border="1"> <apex:column > <apex:facet name="header">Name</apex:facet> {!contact.Name} </apex:column> <apex:column > <apex:facet name="header">Email</apex:facet> {!contact.Email} </apex:column> </apex:dataTable> <apex:form > <br /><br /> <apex:outputLabel value="Subject" for="Subject"/>:<br /> <apex:inputText value="{!subject}" id="Subject" maxlength="80"/> <br /><br /> <apex:outputLabel value="Body" for="Body"/>:<br /> <apex:inputTextarea value="{!body}" id="Body" rows="10" cols="80"/> <br /><br /><br /> <apex:commandButton value="Send Email" action="{!send}" /> </apex:form> </apex:pageBlock> <apex:pageBlock title="Preview the Attachment for {!account.name}"> <c:attachment /> </apex:pageBlock> </apex:page> attachement component <apex:component access="global"> <apex:detail relatedList="false" title="false"/> </apex:component> send email controller public class sendEmail { public String subject { get; set; } public String body { get; set; } private final Account account; // Create a constructor that populates the Account object public sendEmail() { account = [SELECT Name, (SELECT Contact.Name, Contact.Email FROM Account.Contacts) FROM Account WHERE Id = :ApexPages.currentPage().getParameters().get('id')]; } public Account getAccount() { return account; } public PageReference send() { // Define the email Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage(); // Reference the attachment page and pass in the account ID PageReference pdf = Page.attachmentPDF; pdf.getParameters().put('id',(String)account.id); pdf.setRedirect(true); // Take the PDF content Blob b = pdf.getContent(); // Create the email attachment Messaging.EmailFileAttachment efa = new Messaging.EmailFileAttachment(); efa.setFileName('attachment.pdf'); efa.setBody(b); String addresses; if (account.Contacts[0].Email != null) { addresses = account.Contacts[0].Email; // Loop through the whole list of contacts and their emails for (Integer i = 1; i < account.Contacts.size(); i++) { if (account.Contacts[i].Email != null) { addresses += ':' + account.Contacts[i].Email; } } } String[] toAddresses = addresses.split(':', 0); // Sets the paramaters of the email email.setSubject( subject ); email.setToAddresses( toAddresses ); email.setPlainTextBody( body ); email.setFileAttachments(new Messaging.EmailFileAttachment[] {efa}); // Sends the email Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email}); return null; } }
  • September 21, 2012
  • Like
  • 0

i have one visual force page which is used to render a pdf,and i created one more visualforce page2 which is used to show table data in VF1 ,i want to bring VF2 in VF1,i have used iframe it is not working

  • September 18, 2012
  • Like
  • 0

i have one visual force page which is used to render a pdf,and i created one more visualforce page2 which is used to show table data in VF1 ,i want to bring VF2 in VF1,i have used iframe it is not working

  • September 18, 2012
  • Like
  • 0