• MBouin__35dev
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 0
    Replies

Hello

 

I am setting up an Apex Class that will be used for sending an email, but I get the error that is mentioned in the subject

 

Thanks for your help

 

 

public class sendEmail {
public String subject { get; set; }
public String body { get; set; }
private final Playlist__c playlist;


// Create a constructor that populates the Account object
public sendEmail() {
playlist = [select Name,id,Contact__r.Email from Playlist__c where id = :ApexPages.currentPage().getParameters().get('id')];
}

public Playlist__c getPlaylist() {
return playlist;
}

public PageReference send() {
// Define the email
Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
String address = playlist.Contact__r.Email;

// Sets the paramaters of the email
email.setSubject( subject );
email.setToAddresses( address);
email.setPlainTextBody( body );
// Sends the email
Messaging.SendEmailResult [] r =
Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});
return null;
}
}

 

 

 

 

 

Hello

 

I am retrieving a list of records through an extension using a custom controller, however the VF pag returns only 20 records even though there are 100+ of them.

I do not understand that as there is no limit specifier in my query.

 

Might be something silly

 

Thnks for the help

 

 Here is my VF page:

<apex:page standardController="Playlist__c" extensions="exo3" recordSetVar="listPlaylists"> <apex:pageBlock title="Viewing Playlits"> <apex:form id="theForm"> <apex:pageBlockSection > <apex:dataList var="p" value="{!listPlaylists}" type="1" first="0"> {!p.name} </apex:dataList> </apex:pageBlockSection> <apex:panelGrid columns="2"> <apex:commandLink action="{!previous}">Previous</apex:commandlink> <apex:commandLink action="{!next}">Next</apex:commandlink> </apex:panelGrid> </apex:form> </apex:pageBlock> </apex:page>

 

 

Here is the code in the exo3 extension:

public exo3(ApexPages.StandardSetController stdController) {} public ApexPages.StandardSetController setPlaylists {get { if(setPlaylists == null) {setPlaylists = new ApexPages.StandardSetController(Database.getQueryLocator([select name from Playlist__c])); } return setPlaylists ; }set; } public List<Playlist__c> getListPlaylists() { return (List<Playlist__c>) setPlaylists.getRecords(); }

 

 

 

 

 

Hello,

 

In my dev org I have set up this VF page, which shows nicely the job positions available:

 

 

**************

 

<apex:page  standardController="Position__c" recordSetVar="positions" sidebar="false" showHeader="false">
    <apex:pageBlock >
        <h1>Welcome to the Universal Containers Careers Home Page!</h1>
        <p>Universal Containers is an industry leader, and to stay ahead of the pack, we need to grow! We are currently seeking bright and talented professionals to join our winning team.  Browse the current openings below, and send in your resume via email to apply today.</p>
        <br />
        <apex:pageBlockTable value="{!positions}" var="position">
            <apex:column value="{!position.name}" rendered="{!IF(position.Status__c == 'Open - Approved', true, false)}"/>
            <apex:column value="{!position.Location__c}" rendered="{!IF(position.Status__c == 'Open - Approved', true, false)}"/>
            <apex:column value="{!position.Job_Description__c}" rendered="{!IF(position.Status__c == 'Open - Approved', true, false)}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

 

**************

 

 For some reason, when I access this page from the site, the records do not show up.

I have set the Read permission for this object on the Site profile.

 

Any ideas?

 

Thank you for your help.

Marc