-
ChatterFeed
-
0Best Answers
-
1Likes Received
-
0Likes Given
-
13Questions
-
16Replies
How do I write a trigger or workflow alert that sends an email based on changes in campaign member records?
I'm trying to write a trigger (I think) that will send an email whenever a specific field changes on a campaign member record. Basically, the goal is to send an email to an email address associated with a lookup field on the page. Thanks. If this can be done with a workflow alert, even better.
- Will Edwards
- April 03, 2017
- Like
- 0
- Continue reading or reply
How do I show only the leftmost 500 characters of a field in a pageBlockTable?
This is the line I'm trying to fix:
This doesn't work:
Thanks
<apex:column headerValue="Status" headerClass="headerStyle" value="{!con.Status__c}" />
This doesn't work:
<apex:column headerValue="Status" headerClass="headerStyle" value="{!LEFT(con.Status__c,500)}" />
Thanks
- Will Edwards
- February 02, 2017
- Like
- 0
- Continue reading or reply
How do I create a button that updates the record status and creates a related event?
I want to click a button on a campaign member record that will:
- Update the campaign record status
- Create a new related event that I can update
- Will Edwards
- December 12, 2016
- Like
- 0
- Continue reading or reply
How does one combine two lists, merge them, remove duplicates, and then sort in Apex?
In an Apex class, I'd like to take two lists of contacts, merge them, remove duplicate contacts, and then sort them? Any suggestions? Thanks.
- Will Edwards
- October 14, 2016
- Like
- 0
- Continue reading or reply
How do I add a lead to a campaign via Visualforce page?
I'm trying to add a lead to a campaign using VF and Apex. I'd like to add all leads entered via the form to a campaign with status "Responded."
Can you help out? Thanks.
Here's my controller:
And my VF:
Can you help out? Thanks.
Here's my controller:
public class myWeb2LeadExtension { private final Lead weblead; public myWeb2LeadExtension(ApexPages.StandardController stdController) { weblead = (Lead)stdController.getRecord(); } public PageReference saveLead() { try { insert(weblead); } catch(System.DMLException e) { ApexPages.addMessages(e); return null; } PageReference p = Page.ThankYou; p.setRedirect(true); return p; } }
And my VF:
<apex:page standardController="Lead" extensions="myWeb2LeadExtension" title="Register for Digital Accelerator" showHeader="false" standardStylesheets="true"> <head> <script src='https://www.google.com/recaptcha/api.js'></script> </head> <apex:composition template="{!$Site.Template}"> <apex:define name="body"> <apex:form id="theForm"> <apex:messages id="error" styleClass="errorMsg" layout="table" style="margin-top:1em;"/> <apex:pageBlock title="" mode="edit"> <apex:pageBlockButtons > <apex:commandButton value="Submit" action="{!saveLead}"/> </apex:pageBlockButtons> <apex:pageBlockSection title="Register for Digital Accelerator" collapsible="false" columns="1"> <div class = "requiredInput"> <div class = "requiredBlock"></div> <apex:inputField value="{!Lead.FirstName}" required="true"/> <apex:inputField value="{!Lead.LastName}" required="true"/> <apex:inputField value="{!Lead.Nickname__c}" label="Nickname" required="False"/> <apex:inputField value="{!Lead.Title}" required="true"/> <apex:inputField value="{!Lead.Email}" required="true"/> <apex:inputField value="{!Lead.Company}" required="true"/> <apex:inputField value="{!Lead.Phone}" required="true"/> <apex:inputField value="{!Lead.Mailing_Address__c}" required="true"/> <apex:inputHidden value="{!Lead.Campaign.Id}" id="hiddenField3"/> <apex:inputHidden value="{!Member_Status}" id="hiddenField4"/> <script> document.getElementById('{!$Component.theForm}').elements['{!$Component.hiddenField3}'].value = '7013B000000MAma'; </script> <script> document.getElementById('{!$Component.theForm}').elements['{!$Component.hiddenField4}'].value = 'Responded'; </script> </div> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:define> </apex:composition> </apex:page>
- Will Edwards
- June 14, 2016
- Like
- 0
- Continue reading or reply
What's wrong with this use of inputHidden?
I'm trying to fill a hidden custom field through a parameter provided via the URL in a Visualforce page on a Force.com site that creates leads. I'm getting the following error: "Error: Literal value is required for attribute id in apex:inputHidden in NomineeRegistration at line 38 column 99."
Here's my Apex:
And the highlights of the VF page:
Here's my Apex:
public class myWeb2LeadExtension { private final Lead weblead; public myWeb2LeadExtension(ApexPages.StandardController stdController) { weblead = (Lead)stdController.getRecord(); } public PageReference saveLead() { try { insert(weblead); } catch(System.DMLException e) { ApexPages.addMessages(e); return null; } PageReference p = Page.ThankYou; p.setRedirect(true); return p; }
And the highlights of the VF page:
<apex:page standardController="Lead" extensions="myWeb2LeadExtension" title="Register for Digital Accelerator" showHeader="false" standardStylesheets="true"> <apex:composition template="{!$Site.Template}"> <apex:define name="body"> <apex:form > <apex:messages id="error" styleClass="errorMsg" layout="table" style="margin-top:1em;"/> <apex:pageBlock title="" mode="edit"> <apex:pageBlockButtons > <apex:commandButton value="Submit" action="{!saveLead}"/> </apex:pageBlockButtons> <apex:pageBlockSection title="Register for Digital Accelerator" collapsible="false" columns="1"> <div class = "requiredInput"> <div class = "requiredBlock"></div> <apex:inputField value="{!Lead.FirstName}" required="true"/> <apex:inputField value="{!Lead.LastName}" required="true"/> <apex:inputField value="{!Lead.Nickname__c}" required="false"/> <apex:inputField value="{!Lead.Title}" required="true"/> <apex:inputField value="{!Lead.Email}" required="true"/> <apex:inputField value="{!Lead.Company}" required="true"/> <apex:inputField value="{!Lead.Phone}" required="true"/> <apex:inputField value="{!Lead.Mailing_Address__c}" required="true"/> </div> <apex:inputHidden id="{!Lead.Referred_By__c}" value="{!$CurrentPage.parameters.Referred"/> </apex:pageBlockSection> </apex:pageBlock>
- Will Edwards
- June 13, 2016
- Like
- 0
- Continue reading or reply
How do I have a two-stage lead creation process?
I would like to use Force.com, Visualforce, and Apex to create a two-stage lead creation process. I'd like for person A to access a Visualforce page on a Force.com site.
Here's the Visualforce code for the first nomination form.
Any recommendations?
Here's the Visualforce code for the first nomination form.
<apex:page standardController="Lead" extensions="myWeb2LeadExtension" title="Submit Nominee for Digital Accelerator" showHeader="false" standardStylesheets="true"> <apex:composition template="{!$Site.Template}"> <apex:define name="body"> <apex:form > <apex:messages id="error" styleClass="errorMsg" layout="table" style="margin-top:1em;"/> <apex:pageBlock title="" mode="edit"> <apex:pageBlockButtons > <apex:commandButton value="Submit" action="{!saveLead}"/> </apex:pageBlockButtons> <apex:pageBlockSection title="Contact Us" collapsible="false" columns="1"> <div class = "requiredInput"> <div class = "requiredBlock"></div> <apex:inputField value="{!Lead.FirstName}" required="true"/> <apex:inputField value="{!Lead.LastName}" required="true"/> <apex:inputField value="{!Lead.Title}" required="true"/> <apex:inputField value="{!Lead.Email}" required="true"/> <apex:inputField value="{!Lead.Company}" required="true"/> </div> <input type="hidden" name="Campaign_ID" value="{$CurrentPage.parameters.MeetingValue}" /> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:define> </apex:composition> </apex:page>And the Apex controller:
public class myWeb2LeadExtension { private final Lead weblead; public myWeb2LeadExtension(ApexPages.StandardController stdController) { weblead = (Lead)stdController.getRecord(); } public PageReference saveLead() { try { insert(weblead); } catch(System.DMLException e) { ApexPages.addMessages(e); return null; } PageReference p = Page.ThankYou; p.setRedirect(true); return p; } }This will create a lead with some of the information. I'd then like to send a link to the nominee with most of the information filled in and request they add some follow up information. I was thinking of having a hidden value of the lead ID passed through the URL and then writing an Apex controller to update that specific lead.
Any recommendations?
- Will Edwards
- June 12, 2016
- Like
- 0
- Continue reading or reply
What entityId to a put for a custom VF page?
I'm trying to put a Chatter feed on a custom VF page. I thought I could to the following:
<apex:page >
<chatter:feedWithFollowers entityId="{!$CurrentPage.Id}" />
</apex:page>
But there's no Id associated with the page. Any tips? Thanks.
<apex:page >
<chatter:feedWithFollowers entityId="{!$CurrentPage.Id}" />
</apex:page>
But there's no Id associated with the page. Any tips? Thanks.
- Will Edwards
- June 01, 2016
- Like
- 0
- Continue reading or reply
Create a trigger to post field from a campaign member record to the contact Chatter feed after campaign closes?
I'd like to create a trigger that posts a field from a campaign member record to the associated contact's Chatter feed after the campaign status is changed to closed. Thanks.
- Will Edwards
- May 09, 2016
- Like
- 0
- Continue reading or reply
How does one display the column header value at the top of all pages when rendered as PDF?
Using pageBlockTable, I'd like to show a long list of Members (contacts) with various Renewal statuses. I'd like the column header to appear on all pages. Is this possible?
<apex:pageBlockTable value="{!FinalConList}" var="con"> <apex:column headerValue="Renewal" headerClass="headerStyle" value="{!con.CV_Impact_Status__c}" /> <apex:column headerValue="Member" headerClass="headerStyle" value="{!con.FirstName} {!con.LastName} - {!con.Account.Company_Nickname__c}" /> </apex:pageBlockTable>
- Will Edwards
- March 21, 2016
- Like
- 1
- Continue reading or reply
How do I create a class that includes all contacts related to accounts related to a campaign?
I want to create a VF page that shows fields from all contact records that belong to accounts related to a particular campaign. To do that I'll need to create a class in Apex that pulls all contacts with any of the account IDs that belong to campaign members. I understand it will involved nested statements, but I'm not quite sure how to get started. Thanks.
- Will Edwards
- March 21, 2016
- Like
- 0
- Continue reading or reply
How does one transpose rows in a pageblocktable into columns?
I have several values for a child campaign that I'd like to display as columns rather than rows.
I would like the first row to be Hidden_Speaker_Name__c and the second row to be Average_Speaker_Value__c, rather than columbs as they are now. Thanks.
My controller:
I would like the first row to be Hidden_Speaker_Name__c and the second row to be Average_Speaker_Value__c, rather than columbs as they are now. Thanks.
My controller:
public class CampaignController { public Campaign camp {get; set;} public CampaignController(ApexPages.StandardController controller) { camp = (Campaign) controller.getRecord(); if(camp != null && camp.Id != null) { camp = [Select Id, Name, (Select Id, Average_Speaker_Value__c, Hidden_Speaker_Name__c, Type FROM ChildCampaigns WHERE Type = 'Speakers') FROM Campaign WHERE Id =: camp.Id]; } } }My current code:
<apex:pageBlockTable value="{!camp.ChildCampaigns}" var="cc" > <apex:column headerValue="Speaker" headerClass="headerStyle" value="!cc.Hidden_Speaker_Name__c}"/> <apex:column headerValue="Score" headerClass="headerStyle" value="!cc.Average_Speaker_Value__c}"/> </apex:pageBlockTable>
- Will Edwards
- March 21, 2016
- Like
- 0
- Continue reading or reply
Is there a way to reference child campaigns on a Visualforce page located on the parent campaign?
I'm trying to pull a field from all child campaigns and reference it on a Visualforce page accessed via a button on the parent campaign. Is there anyway to do that? Thanks.
- Will Edwards
- March 20, 2016
- Like
- 0
- Continue reading or reply
How does one display the column header value at the top of all pages when rendered as PDF?
Using pageBlockTable, I'd like to show a long list of Members (contacts) with various Renewal statuses. I'd like the column header to appear on all pages. Is this possible?
<apex:pageBlockTable value="{!FinalConList}" var="con"> <apex:column headerValue="Renewal" headerClass="headerStyle" value="{!con.CV_Impact_Status__c}" /> <apex:column headerValue="Member" headerClass="headerStyle" value="{!con.FirstName} {!con.LastName} - {!con.Account.Company_Nickname__c}" /> </apex:pageBlockTable>
- Will Edwards
- March 21, 2016
- Like
- 1
- Continue reading or reply
How do I write a trigger or workflow alert that sends an email based on changes in campaign member records?
I'm trying to write a trigger (I think) that will send an email whenever a specific field changes on a campaign member record. Basically, the goal is to send an email to an email address associated with a lookup field on the page. Thanks. If this can be done with a workflow alert, even better.
- Will Edwards
- April 03, 2017
- Like
- 0
- Continue reading or reply
How do I show only the leftmost 500 characters of a field in a pageBlockTable?
This is the line I'm trying to fix:
This doesn't work:
Thanks
<apex:column headerValue="Status" headerClass="headerStyle" value="{!con.Status__c}" />
This doesn't work:
<apex:column headerValue="Status" headerClass="headerStyle" value="{!LEFT(con.Status__c,500)}" />
Thanks
- Will Edwards
- February 02, 2017
- Like
- 0
- Continue reading or reply
How do I create a button that updates the record status and creates a related event?
I want to click a button on a campaign member record that will:
- Update the campaign record status
- Create a new related event that I can update
- Will Edwards
- December 12, 2016
- Like
- 0
- Continue reading or reply
How does one combine two lists, merge them, remove duplicates, and then sort in Apex?
In an Apex class, I'd like to take two lists of contacts, merge them, remove duplicate contacts, and then sort them? Any suggestions? Thanks.
- Will Edwards
- October 14, 2016
- Like
- 0
- Continue reading or reply
How do I add a lead to a campaign via Visualforce page?
I'm trying to add a lead to a campaign using VF and Apex. I'd like to add all leads entered via the form to a campaign with status "Responded."
Can you help out? Thanks.
Here's my controller:
And my VF:
Can you help out? Thanks.
Here's my controller:
public class myWeb2LeadExtension { private final Lead weblead; public myWeb2LeadExtension(ApexPages.StandardController stdController) { weblead = (Lead)stdController.getRecord(); } public PageReference saveLead() { try { insert(weblead); } catch(System.DMLException e) { ApexPages.addMessages(e); return null; } PageReference p = Page.ThankYou; p.setRedirect(true); return p; } }
And my VF:
<apex:page standardController="Lead" extensions="myWeb2LeadExtension" title="Register for Digital Accelerator" showHeader="false" standardStylesheets="true"> <head> <script src='https://www.google.com/recaptcha/api.js'></script> </head> <apex:composition template="{!$Site.Template}"> <apex:define name="body"> <apex:form id="theForm"> <apex:messages id="error" styleClass="errorMsg" layout="table" style="margin-top:1em;"/> <apex:pageBlock title="" mode="edit"> <apex:pageBlockButtons > <apex:commandButton value="Submit" action="{!saveLead}"/> </apex:pageBlockButtons> <apex:pageBlockSection title="Register for Digital Accelerator" collapsible="false" columns="1"> <div class = "requiredInput"> <div class = "requiredBlock"></div> <apex:inputField value="{!Lead.FirstName}" required="true"/> <apex:inputField value="{!Lead.LastName}" required="true"/> <apex:inputField value="{!Lead.Nickname__c}" label="Nickname" required="False"/> <apex:inputField value="{!Lead.Title}" required="true"/> <apex:inputField value="{!Lead.Email}" required="true"/> <apex:inputField value="{!Lead.Company}" required="true"/> <apex:inputField value="{!Lead.Phone}" required="true"/> <apex:inputField value="{!Lead.Mailing_Address__c}" required="true"/> <apex:inputHidden value="{!Lead.Campaign.Id}" id="hiddenField3"/> <apex:inputHidden value="{!Member_Status}" id="hiddenField4"/> <script> document.getElementById('{!$Component.theForm}').elements['{!$Component.hiddenField3}'].value = '7013B000000MAma'; </script> <script> document.getElementById('{!$Component.theForm}').elements['{!$Component.hiddenField4}'].value = 'Responded'; </script> </div> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:define> </apex:composition> </apex:page>
- Will Edwards
- June 14, 2016
- Like
- 0
- Continue reading or reply
What's wrong with this use of inputHidden?
I'm trying to fill a hidden custom field through a parameter provided via the URL in a Visualforce page on a Force.com site that creates leads. I'm getting the following error: "Error: Literal value is required for attribute id in apex:inputHidden in NomineeRegistration at line 38 column 99."
Here's my Apex:
And the highlights of the VF page:
Here's my Apex:
public class myWeb2LeadExtension { private final Lead weblead; public myWeb2LeadExtension(ApexPages.StandardController stdController) { weblead = (Lead)stdController.getRecord(); } public PageReference saveLead() { try { insert(weblead); } catch(System.DMLException e) { ApexPages.addMessages(e); return null; } PageReference p = Page.ThankYou; p.setRedirect(true); return p; }
And the highlights of the VF page:
<apex:page standardController="Lead" extensions="myWeb2LeadExtension" title="Register for Digital Accelerator" showHeader="false" standardStylesheets="true"> <apex:composition template="{!$Site.Template}"> <apex:define name="body"> <apex:form > <apex:messages id="error" styleClass="errorMsg" layout="table" style="margin-top:1em;"/> <apex:pageBlock title="" mode="edit"> <apex:pageBlockButtons > <apex:commandButton value="Submit" action="{!saveLead}"/> </apex:pageBlockButtons> <apex:pageBlockSection title="Register for Digital Accelerator" collapsible="false" columns="1"> <div class = "requiredInput"> <div class = "requiredBlock"></div> <apex:inputField value="{!Lead.FirstName}" required="true"/> <apex:inputField value="{!Lead.LastName}" required="true"/> <apex:inputField value="{!Lead.Nickname__c}" required="false"/> <apex:inputField value="{!Lead.Title}" required="true"/> <apex:inputField value="{!Lead.Email}" required="true"/> <apex:inputField value="{!Lead.Company}" required="true"/> <apex:inputField value="{!Lead.Phone}" required="true"/> <apex:inputField value="{!Lead.Mailing_Address__c}" required="true"/> </div> <apex:inputHidden id="{!Lead.Referred_By__c}" value="{!$CurrentPage.parameters.Referred"/> </apex:pageBlockSection> </apex:pageBlock>
- Will Edwards
- June 13, 2016
- Like
- 0
- Continue reading or reply
How do I have a two-stage lead creation process?
I would like to use Force.com, Visualforce, and Apex to create a two-stage lead creation process. I'd like for person A to access a Visualforce page on a Force.com site.
Here's the Visualforce code for the first nomination form.
Any recommendations?
Here's the Visualforce code for the first nomination form.
<apex:page standardController="Lead" extensions="myWeb2LeadExtension" title="Submit Nominee for Digital Accelerator" showHeader="false" standardStylesheets="true"> <apex:composition template="{!$Site.Template}"> <apex:define name="body"> <apex:form > <apex:messages id="error" styleClass="errorMsg" layout="table" style="margin-top:1em;"/> <apex:pageBlock title="" mode="edit"> <apex:pageBlockButtons > <apex:commandButton value="Submit" action="{!saveLead}"/> </apex:pageBlockButtons> <apex:pageBlockSection title="Contact Us" collapsible="false" columns="1"> <div class = "requiredInput"> <div class = "requiredBlock"></div> <apex:inputField value="{!Lead.FirstName}" required="true"/> <apex:inputField value="{!Lead.LastName}" required="true"/> <apex:inputField value="{!Lead.Title}" required="true"/> <apex:inputField value="{!Lead.Email}" required="true"/> <apex:inputField value="{!Lead.Company}" required="true"/> </div> <input type="hidden" name="Campaign_ID" value="{$CurrentPage.parameters.MeetingValue}" /> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:define> </apex:composition> </apex:page>And the Apex controller:
public class myWeb2LeadExtension { private final Lead weblead; public myWeb2LeadExtension(ApexPages.StandardController stdController) { weblead = (Lead)stdController.getRecord(); } public PageReference saveLead() { try { insert(weblead); } catch(System.DMLException e) { ApexPages.addMessages(e); return null; } PageReference p = Page.ThankYou; p.setRedirect(true); return p; } }This will create a lead with some of the information. I'd then like to send a link to the nominee with most of the information filled in and request they add some follow up information. I was thinking of having a hidden value of the lead ID passed through the URL and then writing an Apex controller to update that specific lead.
Any recommendations?
- Will Edwards
- June 12, 2016
- Like
- 0
- Continue reading or reply
What entityId to a put for a custom VF page?
I'm trying to put a Chatter feed on a custom VF page. I thought I could to the following:
<apex:page >
<chatter:feedWithFollowers entityId="{!$CurrentPage.Id}" />
</apex:page>
But there's no Id associated with the page. Any tips? Thanks.
<apex:page >
<chatter:feedWithFollowers entityId="{!$CurrentPage.Id}" />
</apex:page>
But there's no Id associated with the page. Any tips? Thanks.
- Will Edwards
- June 01, 2016
- Like
- 0
- Continue reading or reply
How do I create a class that includes all contacts related to accounts related to a campaign?
I want to create a VF page that shows fields from all contact records that belong to accounts related to a particular campaign. To do that I'll need to create a class in Apex that pulls all contacts with any of the account IDs that belong to campaign members. I understand it will involved nested statements, but I'm not quite sure how to get started. Thanks.
- Will Edwards
- March 21, 2016
- Like
- 0
- Continue reading or reply
Is there a way to reference child campaigns on a Visualforce page located on the parent campaign?
I'm trying to pull a field from all child campaigns and reference it on a Visualforce page accessed via a button on the parent campaign. Is there anyway to do that? Thanks.
- Will Edwards
- March 20, 2016
- Like
- 0
- Continue reading or reply