• ellsajames11.3892668100636045E12
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 4
    Replies
I am trying to pull an image from a Rich text area field on Account object to a field on a related custom object. Has anyone done this before or have any advise on the easiest way to do it?.

Basically, the data from the standard Account object is being pulled across (via formula fields) to a related custom object. I am struggling with pulling accross the image from a rich text area field.

Any ideas on best practice for doing this?
Hello experts,

I was wondering if it is possible to have a trigger fire off the "Responded" checkbox (Or a custom field) on the campaign member object? What I would like to achieve is this----

If a campaign member resonds to campaign A (Ie: "Responded" checkbox is true). I would the like a trigger to assign them to campaign B. (Or create a new campaign member record for them on campaign B)

If they do not respond to campaign A, then the trigger should assign them to campaign C.

Basically I would like to route campaign members through a series of campaigns based on if they respond or not.

If anyone could post some code to achieve this or at least point me in the right direction I would appreciate it.

Thanks.
Graham
I am just starting to learn Apex and have written the below trigger--

===========================================================
trigger newlead on Opportunity (Before Insert) {

    List<Lead> c = new List <Lead>();     
        For(Opportunity Newopp : trigger.new){
            If(Newopp.stagename != 'Needs Analysis'&& Newopp.Amount > 500 && Newopp.NextStep != null){
   
    c.Add(new Lead(
        LastName = 'It worked again',
        Title = 'Doctor',
        Company = Newopp.Name)       
    );
            }   
        } 
   
    Insert c; 
}
=======================================
Basically the trigger creates a new lead record when specific criteria is met on a new opportunity record and populates the new lead with some basic information. 

The trigger is working as expected. However since I am just learning, I am trying to expand and add different functionality to the trigger. I wanted to try and populate the "Campaign" field on the newly created leads with the value from the "Campaign" field from the opportunity.

I am sure I will need to insert an Soql query to do this but do not know where or how to insert this in the code. I would appreciate if someone could insert this functionality into my existing code so I can see how this is done. Again, this is purely for learning purposes. If I can see where the code is added and what code exactly, I think this would help me understand how to populate lookup fields via triggers going forward.

Any help is greatly appreciated.

Thanks. 
I am just starting to learn Apex and have written the below trigger--

===========================================================
trigger newlead on Opportunity (Before Insert) {

    List<Lead> c = new List <Lead>();     
        For(Opportunity Newopp : trigger.new){
            If(Newopp.stagename != 'Needs Analysis'&& Newopp.Amount > 500 && Newopp.NextStep != null){
   
    c.Add(new Lead(
        LastName = 'It worked again',
        Title = 'Doctor',
        Company = Newopp.Name)       
    );
            }   
        } 
   
    Insert c; 
}
=======================================
Basically the trigger creates a new lead record when specific criteria is met on a new opportunity record and populates the new lead with some basic information. 

The trigger is working as expected. However since I am just learning, I am trying to expand and add different functionality to the trigger. I wanted to try and populate the "Campaign" field on the newly created leads with the value from the "Campaign" field from the opportunity.

I am sure I will need to insert an Soql query to do this but do not know where or how to insert this in the code. I would appreciate if someone could insert this functionality into my existing code so I can see how this is done. Again, this is purely for learning purposes. If I can see where the code is added and what code exactly, I think this would help me understand how to populate lookup fields via triggers going forward.

Any help is greatly appreciated.

Thanks. 
Hello experts,

I was wondering if it is possible to have a trigger fire off the "Responded" checkbox (Or a custom field) on the campaign member object? What I would like to achieve is this----

If a campaign member resonds to campaign A (Ie: "Responded" checkbox is true). I would the like a trigger to assign them to campaign B. (Or create a new campaign member record for them on campaign B)

If they do not respond to campaign A, then the trigger should assign them to campaign C.

Basically I would like to route campaign members through a series of campaigns based on if they respond or not.

If anyone could post some code to achieve this or at least point me in the right direction I would appreciate it.

Thanks.
Graham
I am just starting to learn Apex and have written the below trigger--

===========================================================
trigger newlead on Opportunity (Before Insert) {

    List<Lead> c = new List <Lead>();     
        For(Opportunity Newopp : trigger.new){
            If(Newopp.stagename != 'Needs Analysis'&& Newopp.Amount > 500 && Newopp.NextStep != null){
   
    c.Add(new Lead(
        LastName = 'It worked again',
        Title = 'Doctor',
        Company = Newopp.Name)       
    );
            }   
        } 
   
    Insert c; 
}
=======================================
Basically the trigger creates a new lead record when specific criteria is met on a new opportunity record and populates the new lead with some basic information. 

The trigger is working as expected. However since I am just learning, I am trying to expand and add different functionality to the trigger. I wanted to try and populate the "Campaign" field on the newly created leads with the value from the "Campaign" field from the opportunity.

I am sure I will need to insert an Soql query to do this but do not know where or how to insert this in the code. I would appreciate if someone could insert this functionality into my existing code so I can see how this is done. Again, this is purely for learning purposes. If I can see where the code is added and what code exactly, I think this would help me understand how to populate lookup fields via triggers going forward.

Any help is greatly appreciated.

Thanks.