I've created a custom object to add an 'Attended' checkbox for invitees to an event. I've created a visualforce page list the events with a link to the attendance page where they can see a list of invitees and check a box to indicate that the invitee actually attended the event. The link from the events list page passes the event ID in the URL. I would like the invitees page to list all contacts (don't care about users or leads) and, ideally, allow the user to check the box directly from the list for each contact attending. If that's not possible, I don't mind having an Edit link for each invitee to check the Attended box.
I'm relatively new to SalesForce so I'm having trouble figuring out the best way to do this. I need to: 1. Add a button or a trigger to get the invitee list (and preferably the response status) from the Event Relation and Accepted Event standard objects to add records to the custom Event Attendance object with logic to prevent duplicating invitees for a particular event.
- Display the list of invitees for a particular event from the custom Event Attendance object with a way to change the response status and attended checkbox and save the record to the custom object.
Below is the code I've tried so far but the EventListController gives me errors:
List Events:
public with sharing class List_Events_Controller {
public List_Events_Controller(ApexPages.StandardController controller) {
events = [SELECT ID, Subject, Description, ACTIVITYDATE FROM Event];
}
public List<Event>events {get; set;}
and
{!event.Subject}
This page works fine the invitee list is where I'm stuck:
public with sharing class InviteeListController {
public InviteeListController(ApexPages.StandardController controller) {
eventinvitees= [Select Id, OwnerId, IsDeleted, Name, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, LastActivityDate, LastViewedDate, LastReferencedDate, Status__c, Attended__c, Relation_id__c, EventID__c, Event__c FROM Event_Attendance__c WHERE EventID__c = '{!$CurrentPage.parameters.EventID}'];
}
public List<Event_Attendance__c>eventinvitees{get; set;}
}
and
<apex:page Controller="InviteeListController">
<apex:sectionHeader title="Event Attendance" subtitle="List of Invitees"/>
<apex:pageBlock title="Invitees">
<apex:pageBlockTable value="{!eventinvitees}" var="eventinvitee">
<apex:column value="{!eventinvitees.event_c}"/>
<apex:column value="{!eventinvitees.attended}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
with the following error: Error: Unknown constructor 'InviteeListController.InviteeListController()'
Any thoughts would be appreciated.
Thanks