• Jamie Fellrath
  • NEWBIE
  • 20 Points
  • Member since 2016
  • Application Developer/Data Analyst
  • Ohio Tuition Trust Authority


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

Hi all,

I'm trying to create a new report based on the Tasks and Events model, but with additional fields that aren't in the T&E model (account.industry and a custom field I added to account). I tried using the Activities with Accounts model instead, and it has those fields, but it doesn't return all the same data (much less data, actually).  

Is there a way to add those fields to the Tasks & Events report I created? 

Thanks,

Jamie

I am creating a process to dynamically apply a new owner to a Lead (and change the value of a Field in Lead) after it's created on a Web-to-Lead page (it's being entered with me and it needs to apply it to someone else, based on a record value in a custom object).  

I was thinking that the most efficient way to do this would be to use a flow and then invoke the flow from the process, triggered on the creation of the Lead. 

However, I am not sure how to pass the value of the Lead itself to the flow as the process invokes it. How will my flow know which Lead it's working with? 

I've seen this question asked elsewhere without an answer. Is this even possible?

Hi all,

Just getting started with Apex and Visualforce pages and I hope someone can help me out here.  We have account reps who need me to create a public-facing contact entry page that takes a parameter. The parameter is just for tracking purposes and is written to a custom field called Lead_Channel__c. (So the URL is something like http://ourorg.force.com/?Lead_Channel=<eventname> and the parameter is written to Lead_Channel__c).

The idea is to get the person's contact information - First/Last name, email, phone, title... and Company Name.

The trick is that Company Name - it's an Account field, not a Contact field. I have the page working to create the Contact right now, but they want it to create a new Account and Contact. 

Here's my VF page code, after my having added a field for the Contact.Account.Name (the working version simply omits that line):
<apex:page controller="ContactCreateController" showHeader="false" sidebar="false">
	<apex:sectionHeader subtitle="Create a Contact" />
	<apex:form style="margin-left: 210px; margin-top: 50px; margin-bottom: 100px; margin-right: 210px;">
		<apex:pageMessages />
		<apex:pageBlock title="New Contact Entry">
			<apex:pageBlockButtons >
				<apex:commandButton action="{!save}" value="Save"/>
			</apex:pageBlockButtons>

			<apex:pageBlockSection showHeader="false" columns="2">
				<apex:inputField value="{! Contact.FirstName }" />
				<apex:inputField value="{! Contact.LastName }" />
				<apex:inputField value="{! Contact.Email }" />
				<apex:inputField value="{! Contact.Phone }" />
				<apex:inputField value="{! Contact.Title }" />
				<apex:inputField value="{! Contact.Account.Name }" />
			</apex:pageBlockSection>
		</apex:pageBlock>
	</apex:form>
</apex:page>
And here's the Custom Controller code - without changes to insert the Account based on the name, first.
 
public with sharing class ContactCreateController {
    private String leadChannel {get;set;}
    // the contact record you are adding values to
    public Contact contact {
        get {
            if (contact == null)
                contact = new Contact();
            return contact;
        }
        set;
    }
    
    public ContactCreateController() {
        /* Extract lead channel from URL and assign to variable */
        leadChannel  = ApexPages.currentPage().getParameters().get('Lead_Channel');
    }
    
    // save button is clicked
    public PageReference save() {
        try {
            contact.Lead_Channel__c  = leadChannel; /*Save lead channel to contact */
            insert contact; // inserts the new record into the database
        } catch (DMLException e) {
            ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,'Error creating new contact.'));
            return null;
        }
        
        // if successfully inserted new contact, then displays the thank you page.
        return Page.ContactCreateThankyou;
    }
}

The ContactCreateThankYou page simple displays the new data and then any other additions the reps want to add in.

Can anyone help me to modify my code to get that Account added? 

Thanks,

Jamie
 

I am creating a process to dynamically apply a new owner to a Lead (and change the value of a Field in Lead) after it's created on a Web-to-Lead page (it's being entered with me and it needs to apply it to someone else, based on a record value in a custom object).  

I was thinking that the most efficient way to do this would be to use a flow and then invoke the flow from the process, triggered on the creation of the Lead. 

However, I am not sure how to pass the value of the Lead itself to the flow as the process invokes it. How will my flow know which Lead it's working with? 

I've seen this question asked elsewhere without an answer. Is this even possible?

Hi all,

I'm trying to create a new report based on the Tasks and Events model, but with additional fields that aren't in the T&E model (account.industry and a custom field I added to account). I tried using the Activities with Accounts model instead, and it has those fields, but it doesn't return all the same data (much less data, actually).  

Is there a way to add those fields to the Tasks & Events report I created? 

Thanks,

Jamie

I am creating a process to dynamically apply a new owner to a Lead (and change the value of a Field in Lead) after it's created on a Web-to-Lead page (it's being entered with me and it needs to apply it to someone else, based on a record value in a custom object).  

I was thinking that the most efficient way to do this would be to use a flow and then invoke the flow from the process, triggered on the creation of the Lead. 

However, I am not sure how to pass the value of the Lead itself to the flow as the process invokes it. How will my flow know which Lead it's working with? 

I've seen this question asked elsewhere without an answer. Is this even possible?

Hi all,

Just getting started with Apex and Visualforce pages and I hope someone can help me out here.  We have account reps who need me to create a public-facing contact entry page that takes a parameter. The parameter is just for tracking purposes and is written to a custom field called Lead_Channel__c. (So the URL is something like http://ourorg.force.com/?Lead_Channel=<eventname> and the parameter is written to Lead_Channel__c).

The idea is to get the person's contact information - First/Last name, email, phone, title... and Company Name.

The trick is that Company Name - it's an Account field, not a Contact field. I have the page working to create the Contact right now, but they want it to create a new Account and Contact. 

Here's my VF page code, after my having added a field for the Contact.Account.Name (the working version simply omits that line):
<apex:page controller="ContactCreateController" showHeader="false" sidebar="false">
	<apex:sectionHeader subtitle="Create a Contact" />
	<apex:form style="margin-left: 210px; margin-top: 50px; margin-bottom: 100px; margin-right: 210px;">
		<apex:pageMessages />
		<apex:pageBlock title="New Contact Entry">
			<apex:pageBlockButtons >
				<apex:commandButton action="{!save}" value="Save"/>
			</apex:pageBlockButtons>

			<apex:pageBlockSection showHeader="false" columns="2">
				<apex:inputField value="{! Contact.FirstName }" />
				<apex:inputField value="{! Contact.LastName }" />
				<apex:inputField value="{! Contact.Email }" />
				<apex:inputField value="{! Contact.Phone }" />
				<apex:inputField value="{! Contact.Title }" />
				<apex:inputField value="{! Contact.Account.Name }" />
			</apex:pageBlockSection>
		</apex:pageBlock>
	</apex:form>
</apex:page>
And here's the Custom Controller code - without changes to insert the Account based on the name, first.
 
public with sharing class ContactCreateController {
    private String leadChannel {get;set;}
    // the contact record you are adding values to
    public Contact contact {
        get {
            if (contact == null)
                contact = new Contact();
            return contact;
        }
        set;
    }
    
    public ContactCreateController() {
        /* Extract lead channel from URL and assign to variable */
        leadChannel  = ApexPages.currentPage().getParameters().get('Lead_Channel');
    }
    
    // save button is clicked
    public PageReference save() {
        try {
            contact.Lead_Channel__c  = leadChannel; /*Save lead channel to contact */
            insert contact; // inserts the new record into the database
        } catch (DMLException e) {
            ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,'Error creating new contact.'));
            return null;
        }
        
        // if successfully inserted new contact, then displays the thank you page.
        return Page.ContactCreateThankyou;
    }
}

The ContactCreateThankYou page simple displays the new data and then any other additions the reps want to add in.

Can anyone help me to modify my code to get that Account added? 

Thanks,

Jamie