• Courtney M Brown
  • NEWBIE
  • 20 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 7
    Replies
Hello,

I am using a standard object (Campaign) to track attendence at events.  Working with the "Total Contacts" field (automatically updated when a contact is added to campaign) and a custom "No of Attendees" field, I'm trying to create an Apex Trigger that updates the Campaign record with the current number of attendees whenever that number changes.  

Goal:  Anytime "Total Contacts" changes, I want to pass that value to the "No of Attendees" field.  

Here's what I've tried so far:
trigger AttendeeUpdate on Campaign (before update) {
    for (Campaign obj: trigger.new){
        No_of_Attendees__c = TotalContacts;
    }
}

Error Message:Compile Error: Variable does not exist: No_of_Attendees__c at line 3 column 9

Any help with this is greatly appreciated!
Hi All,

I am using the Campaign object to track my organizations Conference data.  I've searched through the archives but can't find an answer to my question.  

Goal:  Use the visualforce page I created to display just the name of the Conference (field name= "Name") and the number of attendees (field name= No_of_Attendees_c).  I want that info to be housed in an alert box.  I'm new to using javascript and Custom Controllers.  

Here's the code I have so far:
<apex:page controller="Campaign">
  <apex:form >
    <apex:outputlabel value="Campaign Name"/>
       <apex:inputtext value="{!Campaign.Name}">
           <apex:actionsupport event="onclick" rerender="display" />
       </apex:inputtext>                  
    <apex:outputpanel id="display">
        <apex:outputtext value="Number of Attendees {!Campaign.No_of_Attendees__c}"/>
    </apex:outputpanel>                  
  </apex:form>   
</apex:page>

Controller:
public class Campaign
{

    public String getCampaign() {
        return null;
    }

    public String userinput{get; set;}
}

I know I'm doing something wrong...

Thanks in advance
Hello,

I am using a standard object (Campaign) to track attendence at events.  Working with the "Total Contacts" field (automatically updated when a contact is added to campaign) and a custom "No of Attendees" field, I'm trying to create an Apex Trigger that updates the Campaign record with the current number of attendees whenever that number changes.  

Goal:  Anytime "Total Contacts" changes, I want to pass that value to the "No of Attendees" field.  

Here's what I've tried so far:
trigger AttendeeUpdate on Campaign (before update) {
    for (Campaign obj: trigger.new){
        No_of_Attendees__c = TotalContacts;
    }
}

Error Message:Compile Error: Variable does not exist: No_of_Attendees__c at line 3 column 9

Any help with this is greatly appreciated!
Hi All,

I am using the Campaign object to track my organizations Conference data.  I've searched through the archives but can't find an answer to my question.  

Goal:  Use the visualforce page I created to display just the name of the Conference (field name= "Name") and the number of attendees (field name= No_of_Attendees_c).  I want that info to be housed in an alert box.  I'm new to using javascript and Custom Controllers.  

Here's the code I have so far:
<apex:page controller="Campaign">
  <apex:form >
    <apex:outputlabel value="Campaign Name"/>
       <apex:inputtext value="{!Campaign.Name}">
           <apex:actionsupport event="onclick" rerender="display" />
       </apex:inputtext>                  
    <apex:outputpanel id="display">
        <apex:outputtext value="Number of Attendees {!Campaign.No_of_Attendees__c}"/>
    </apex:outputpanel>                  
  </apex:form>   
</apex:page>

Controller:
public class Campaign
{

    public String getCampaign() {
        return null;
    }

    public String userinput{get; set;}
}

I know I'm doing something wrong...

Thanks in advance