• Shahida Robertson
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 3
    Replies
Hello,
I have created a custom field on the Account object called "Primary Contact Email." I need a trigger that will update this field with the Primary Contact's (lookup on the Account) email. I am not a developer, btw. Right now I have: 

trigger UpdateAccountEmails on Contact (after update) {
    Map<Id, Account> m = new Map<Id, Account>();
    for(Contact c : Trigger.new){
        if (Trigger.oldMap.get(c.Id).Email != c.Email) {
            m.put(c.AccountId, new Account(Id = c.AccountId, Primary_Contact_Email__c = c.Email));
        }
    }
    update m.values();

Can anyone help me? Thanks!
Hello,
Disclaimer* I am an Admin with no knowledge of code, but I have to build a process and flow. In order to do this, I need this trigger to accomplish. I have created a custom field on the Account object called "Primary Contact Email." I need a trigger that will update this field with the Primary Contact's (lookup on the Account) email. Right now I have: 

trigger UpdateAccountEmails on Contact (after update) {
    Map<Id, Account> m = new Map<Id, Account>();
    for(Contact c : Trigger.new){
        if (Trigger.oldMap.get(c.Id).Email != c.Email) {
            m.put(c.AccountId, new Account(Id = c.AccountId, Primary_Contact_Email__c = c.Email));
        }
    }
    update m.values();

Can anyone help me? Thanks!
Hi,
I have two membership levels: One standard and one plus membership. I want to create a button on the opportunity layout that will switch from the standard to the plus membership record once this button is clicked. I am not sure of what type of formula to use. Any assistance would be greatly appreciated!
Hello,
I have created a custom field on the Account object called "Primary Contact Email." I need a trigger that will update this field with the Primary Contact's (lookup on the Account) email. I am not a developer, btw. Right now I have: 

trigger UpdateAccountEmails on Contact (after update) {
    Map<Id, Account> m = new Map<Id, Account>();
    for(Contact c : Trigger.new){
        if (Trigger.oldMap.get(c.Id).Email != c.Email) {
            m.put(c.AccountId, new Account(Id = c.AccountId, Primary_Contact_Email__c = c.Email));
        }
    }
    update m.values();

Can anyone help me? Thanks!