• Chris Kuhlman
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
I created a visualforce page for user to edit Campaign Members. When users went to select a value from the picklist dropdown for Status they were only getting the default/standard values that are pre-set for all Campaigns- not the extended list that is created when the user adds values after clicking on Advanced Setup on the Campaign page.
After some sniffing around, I noticed that the addtional Status values are stored in the CampaignMemberStatus table. When you add a new picklist value in Campaign - Advanced Setup it creates a new entry in this table (CampaignID, Label).
I just cant seem to figure out hwo to connect this last piece- can someone please assist?  thanks!

controller:
public with sharing class editclass {
    private final CampaignMember CM;
    private ApexPages.StandardController cont;
    public editclass(ApexPages.StandardController stdcontroller) {
       this.cont = stdController;
        list<string> ls = new list<string>();
        ls.add('Campaign.Name');
        cont.addFields(ls);
       this.CM = (CampaignMember) stdcontroller.getRecord();
      // CM.addFields('Name');
    }
    public string getdisplayName()
    {
         return CM.Name + ' ('+ CM.Campaign.Name + ')';
    }
    
}

visualforce page:
<apex:page standardController="CampaignMember"  sidebar="true" extensions="editclass" tabstyle="CampaignMember">
    <font size="1" >Campaign Member </font>
    <br></br>
    <b>{!displayName} </b><p/>
    <apex:form title="Campaign Member Edit">
            <apex:pageBlock title="Campaign member edit" mode="edit">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="Save"/>
                <apex:commandButton action="{!cancel}" value="Cancel"/>
                        </apex:pageBlockButtons>

               <apex:pageBlockSection title="Campaign Member Section" columns="2" >
                <apex:inputfield value="{!Campaignmember.Campaign.Name}" />
                <apex:inputfield value="{!Campaignmember.HasResponded}" />
                
                <apex:inputfield value="{!Campaignmember.Name}" />
                <apex:inputField value="{!Campaignmember.Notes__c}"/>
                
                <apex:inputField value="{!Campaignmember.ResultCode__c}" />
                <apex:inputField value="{!Campaignmember.Membership_Status__c}"/>
                
                <apex:inputField value="{!Campaignmember.status}"/>
                <apex:inputField value="{!Campaignmember.Guest_Email__c}" />
 
                <apex:inputField value="{!Campaignmember.Guest__c}"/>
                <apex:inputField value="{!Campaignmember.Guest_Phone_Number__c}"/>
                
                <apex:inputField value="{!Campaignmember.Current_Disposition_Detail__c}"/>
                             
               </apex:pageBlockSection>

         </apex:pageBlock>

    </apex:form>

</apex:page>

Thanks!
 
My mobile app is pulling in too many numbers and in an the wrong order. Was looking to omit some of the numbers and change their order.

I tried changing the order of the numbers in the Accounts --> Page Layouts --> (edit) area but it does not change the order of the numbers. If I remove the number from the layout it *does* remove it from the Call Button List popup.

Anyone had any success here?  Thanks...

User-added image
I created a visualforce page for user to edit Campaign Members. When users went to select a value from the picklist dropdown for Status they were only getting the default/standard values that are pre-set for all Campaigns- not the extended list that is created when the user adds values after clicking on Advanced Setup on the Campaign page.
After some sniffing around, I noticed that the addtional Status values are stored in the CampaignMemberStatus table. When you add a new picklist value in Campaign - Advanced Setup it creates a new entry in this table (CampaignID, Label).
I just cant seem to figure out hwo to connect this last piece- can someone please assist?  thanks!

controller:
public with sharing class editclass {
    private final CampaignMember CM;
    private ApexPages.StandardController cont;
    public editclass(ApexPages.StandardController stdcontroller) {
       this.cont = stdController;
        list<string> ls = new list<string>();
        ls.add('Campaign.Name');
        cont.addFields(ls);
       this.CM = (CampaignMember) stdcontroller.getRecord();
      // CM.addFields('Name');
    }
    public string getdisplayName()
    {
         return CM.Name + ' ('+ CM.Campaign.Name + ')';
    }
    
}

visualforce page:
<apex:page standardController="CampaignMember"  sidebar="true" extensions="editclass" tabstyle="CampaignMember">
    <font size="1" >Campaign Member </font>
    <br></br>
    <b>{!displayName} </b><p/>
    <apex:form title="Campaign Member Edit">
            <apex:pageBlock title="Campaign member edit" mode="edit">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="Save"/>
                <apex:commandButton action="{!cancel}" value="Cancel"/>
                        </apex:pageBlockButtons>

               <apex:pageBlockSection title="Campaign Member Section" columns="2" >
                <apex:inputfield value="{!Campaignmember.Campaign.Name}" />
                <apex:inputfield value="{!Campaignmember.HasResponded}" />
                
                <apex:inputfield value="{!Campaignmember.Name}" />
                <apex:inputField value="{!Campaignmember.Notes__c}"/>
                
                <apex:inputField value="{!Campaignmember.ResultCode__c}" />
                <apex:inputField value="{!Campaignmember.Membership_Status__c}"/>
                
                <apex:inputField value="{!Campaignmember.status}"/>
                <apex:inputField value="{!Campaignmember.Guest_Email__c}" />
 
                <apex:inputField value="{!Campaignmember.Guest__c}"/>
                <apex:inputField value="{!Campaignmember.Guest_Phone_Number__c}"/>
                
                <apex:inputField value="{!Campaignmember.Current_Disposition_Detail__c}"/>
                             
               </apex:pageBlockSection>

         </apex:pageBlock>

    </apex:form>

</apex:page>

Thanks!