• mrjaober
  • NEWBIE
  • 0 Points
  • Member since 2012

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

Hello,

 

Could someone give me the code necessary to create a button that goes onto the contact object that allows me to add the contact I am viewing to a campaign?

 

Thanks in advance. 

Hello, I bet this is a simple fix for a real developer. 

I'm using an app whose VF code is below. I get an error when loading my list that says I have exceeded the max view state size limit. Based on some research, it seems I can fix this by using pagination. Can someone help me by providing me the code add to the VF page to add the pagination?

 

The VF markup:

 

<apex:page controller="CampaignCallDownController" > 

  <apex:sectionHeader title="Call Down List" />
  <apex:form id="calls">  
  	<apex:pageBlock >
    <apex:selectList value="{!camp}" size="1">Campaign:
            <apex:selectOptions value="{!campaignItems}"/>
            <apex:actionSupport event="onchange" status="counterStatus" action="{!campaignRefresh}" rerender="calls, status, callList, owners, goToCampaign"/>
        </apex:selectList>&nbsp;&nbsp;
        <apex:outputLink id="goToCampaign" value="/{!camp}" >Go to Campaign</apex:outputLink>
    </apex:pageBlock>
    <apex:pageBlock >
    	<apex:outputPanel layout="block">
    		<apex:outputText >Status:</apex:outputText>
        	<apex:selectList value="{!status}" size="1">
            	<apex:selectOptions value="{!statusItems}"/>
            	<apex:actionSupport event="onchange" status="counterStatus" action="{!campaignRefresh}" rerender="calls"/>
        	</apex:selectList>
        </apex:outputPanel>
        <apex:outputPanel layout="block">
        	<apex:outputText >Owner:</apex:outputText> 
        	<apex:selectList value="{!ownerId}" size="1">
            	<apex:selectOptions value="{!owners}"/>
            	<apex:actionSupport event="onchange" status="counterStatus" action="{!campaignRefresh}" rerender="callList"/>
        	</apex:selectList> 
    	</apex:outputPanel>
    	<apex:outputPanel layout="block" style="position: relative; width: 100%">
        	<apex:outputPanel layout="block" style="float: left;">
        		<apex:outputLink value="{!backRef}" style="line-height: 24px;">Settings</apex:outputLink>
        	</apex:outputPanel>
        	<apex:outputPanel layout="block" style="float: right; padding-right: 5px; padding-bottom: 5px">
        		<apex:commandButton action="{!updateAll}" value="Update All" reRender="callList" status="counterStatus"/>
        	</apex:outputPanel>
        	<apex:outputPanel layout="block" style="clear: both;">
        	</apex:outputPanel>
        </apex:outputPanel>
           <apex:actionStatus id="counterStatus">
              <apex:facet name="start">  
                <apex:outputPanel id="processing">
                  <apex:pageMessage title="Processing..." severity="info" strength="2" rendered="true" />
                  </br>
                  </br>
                  <p><apex:image id="loader" url="{!URLFOR($Resource.CampaignCallDown, '/images/loaderImage.gif')}"/></p>
                </apex:outputPanel>   
              </apex:facet>
              <apex:facet name="stop">
					<apex:pageBlockTable value="{!leadPlusTasks}" var="lpt" id="callList">
						<apex:column value="{!lpt.ownerFirstName} {!lpt.ownerLastName}" headerValue="Owner" rendered="{!$Setup.CampaignColumns__c.OWNER__c}" />
                        <apex:column value="{!lpt.SALUTATION}" headerValue="Salutation" rendered="{!$Setup.CampaignColumns__c.SALUTATION__c}" />
                        <apex:column >
                        	<apex:facet name="header">
                                <apex:commandLink action="{!sortByName}" Value="Name" rerender="calls"/>
                            </apex:facet>
                            <apex:outputLink value="/{!lpt.ID}">{!lpt.NAME}</apex:outputLink>
                        </apex:column>
                        <apex:column value="{!lpt.TITLE}" rendered="{!$Setup.CampaignColumns__c.TITLE__c}">
                         	<apex:facet name="header">
                    			<apex:commandLink action="{!sortByTitle}" Value="Title" rerender="calls"/>
                    		</apex:facet>
                        </apex:column>
                        <apex:column value="{!lpt.COMPANY}" rendered="{!$Setup.CampaignColumns__c.COMPANY__c}">
                         	<apex:facet name="header">
                    			<apex:commandLink action="{!sortByCompany}" Value="Company" rerender="calls"/>
                    		</apex:facet>
                        </apex:column>
                        <apex:column headerValue="Lead/Contact">
                         	<apex:image id="cORlImage1" url="{!URLFOR($Resource.CampaignCallDown, 'images/contactsImage.png')}" rendered="{!lpt.cORl == 'contact'}"/>
                            <apex:image id="cORlImage2" url="{!URLFOR($Resource.CampaignCallDown, 'images/leadsImage.png')}" rendered="{!lpt.cORl == 'lead'}"/>
                        </apex:column>
                        <apex:column headerValue="Address" rendered="{!$Setup.CampaignColumns__c.ADDRESS__c}">
                         	<apex:outputText value="{!lpt.ADDRESS}" escape="false"/>
                        </apex:column>
                        <apex:column headerValue="Email" rendered="{!$Setup.CampaignColumns__c.EMAIL__c}">
                         	<apex:outputText value="{!lpt.EMAIL}" escape="false"/>
                  		</apex:column>
                        <apex:column value="{!lpt.PHONE}" headerValue="Phone" rendered="{!$Setup.CampaignColumns__c.PHONE__c}"/>
                        <apex:column headerValue="Fax" rendered="{!$Setup.CampaignColumns__c.FAX__c}">
                         	<apex:outputText value="{!lpt.FAX}" escape="false"/>
                  		</apex:column>
                      	<apex:column >
							<apex:facet name="header">
                    			<apex:commandLink action="{!sortByStatus}" Value="Status" rerender="calls"/>
                   			</apex:facet>
	                   		<apex:selectList value="{!lpt.statusUpdate}" size="1">
	                    	<apex:selectOptions value="{!lpt.memStatusValue}"/>
	                   		</apex:selectList>
	                  	</apex:column>
	                    <apex:column headerValue="Log A Call">
	                    	<apex:inputTextarea value="{!lpt.t.Description}" cols="25" rows="1" onFocus="this.rows=3;" onBlur="this.rows=1" />
	                    	<br />
	                  	</apex:column> 
	                </apex:pageBlockTable>
	               </apex:facet>
	              </apex:actionStatus>
  </apex:pageBlock> 
  </apex:form>
</apex:page>

Hello,

 

Could someone give me the code necessary to create a button that goes onto the contact object that allows me to add the contact I am viewing to a campaign?

 

Thanks in advance. 

I have a custom button for New Opportunity that pre-populates the Opportunity Name with "ACCOUNT NAME - ".

 

How can I change this button to also include the current year after the account name:  "ACCOUNT NAME - 2010"?

 

Here is what I have right now:

 

/setup/ui/recordtypeselect.jsp?ent=Opportunity&save_new_url=/006/e?retURL=%2F{!NULLVALUE(Contact.Id, Account.Id)}&accid={!Account.Id}&conid={!Contact.Id} &lookupcmpgn=1&opp3={!Account.Name} -

 

Here is what I tried, but it didn't work:

 

/setup/ui/recordtypeselect.jsp?ent=Opportunity&save_new_url=/006/e?retURL=%2F{!NULLVALUE(Contact.Id, Account.Id)}&accid={!Account.Id}&conid={!Contact.Id} &lookupcmpgn=1&opp3={!Account.Name} - (year(date()))

 

Any idea how to get this to work?  Right now I just depend on sales to populate the year, but many are not doing it.

 

Thanks!