• Ryan Bobadilla 10
  • NEWBIE
  • 0 Points
  • Member since 2016

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

I'm a bit stuck on this one.  I'm assuming now it's in this class in this part of the code and what I need to do is not to trigger the contact transfer notification even if the owner is NOT Marketo:

  // if the contact owner is marketo do not send auto email
    List <Contact> lstConvertedContacts = new List <Contact> ();
    List <Lead> lstConvertedLeads = [select Id, ConvertedContactId, ConvertedContact.Owner.Name, ConvertedAccount.OwnerId, ConvertedAccount.Owner.IsActive from Lead where Id in :insertedLeads];
    System.debug('===== About to change Owner of Converted Lead');
        System.debug('===== Currently running user name is ' + [select name from user where id=:UserInfo.getUserId()].Name);
        for (Lead nextConvertedLead : lstConvertedLeads) {
      Contact con = new Contact(
            Id = nextConvertedLead.ConvertedContactId,
            OwnerId = nextConvertedLead.ConvertedAccount.OwnerId,
            Contact_Status__c = 'New');{
        con.setOptions(dlo);
      }
      System.debug('===== Lead Id: ' + nextConvertedLead.Id + ', Contact Id: ' + con.Id + ', nextConvertedLead.ConvertedContact.Owner.Name: ' + nextConvertedLead.ConvertedContact.Owner.Name);
            System.debug('===== nextConvertedLead.ConvertedContact.Owner: ' + nextConvertedLead.ConvertedContact.Owner);
            if (nextConvertedLead.ConvertedContact.Owner.Name == 'Marketo') {
        con.setOptions(dlo);
      }
      lstConvertedContacts.add(con);
    }

    System.debug('===========>>> updating the owner on contacts: '+lstConvertedContacts.size());
    if(!lstConvertedContacts.isEmpty()) {
      update lstConvertedContacts;
    }

Anyone able to help here?  

THANK YOU!

 
Hello

I'm a bit stuck on this one.  I'm assuming now it's in this class in this part of the code and what I need to do is not to trigger the contact transfer notification even if the owner is NOT Marketo:

  // if the contact owner is marketo do not send auto email
    List <Contact> lstConvertedContacts = new List <Contact> ();
    List <Lead> lstConvertedLeads = [select Id, ConvertedContactId, ConvertedContact.Owner.Name, ConvertedAccount.OwnerId, ConvertedAccount.Owner.IsActive from Lead where Id in :insertedLeads];
    System.debug('===== About to change Owner of Converted Lead');
        System.debug('===== Currently running user name is ' + [select name from user where id=:UserInfo.getUserId()].Name);
        for (Lead nextConvertedLead : lstConvertedLeads) {
      Contact con = new Contact(
            Id = nextConvertedLead.ConvertedContactId,
            OwnerId = nextConvertedLead.ConvertedAccount.OwnerId,
            Contact_Status__c = 'New');{
        con.setOptions(dlo);
      }
      System.debug('===== Lead Id: ' + nextConvertedLead.Id + ', Contact Id: ' + con.Id + ', nextConvertedLead.ConvertedContact.Owner.Name: ' + nextConvertedLead.ConvertedContact.Owner.Name);
            System.debug('===== nextConvertedLead.ConvertedContact.Owner: ' + nextConvertedLead.ConvertedContact.Owner);
            if (nextConvertedLead.ConvertedContact.Owner.Name == 'Marketo') {
        con.setOptions(dlo);
      }
      lstConvertedContacts.add(con);
    }

    System.debug('===========>>> updating the owner on contacts: '+lstConvertedContacts.size());
    if(!lstConvertedContacts.isEmpty()) {
      update lstConvertedContacts;
    }

Anyone able to help here?  

THANK YOU!

 
This question involves APEX triggers and APIs so I'm hoping someone can help. I've been SFDC admin and developer for over a decade but this one has me stumped.

My reps are getting flooded by SFDC generated contact transfer notifications and I have no idea how to stop them. Here' the order of events:
1) lead imported to Marketo
2) lead syncs with SFDC
3) SFDC Assignment rules applied (FYI, no email templates are used in this step)
4) Lead auto convereted by trigger and attched to Account
5) New Contact owner changed to match Account owner by trigger

There are no workflow or notification settings that I can see that would create a transfer notification...and here's the really wierd part. If I do all of the above steps, except start it by manually creating a lead in the SFDC UI, then no notification is sent. This only happens when the lead is injected from Marketo. That said, I am 100% sure the notification is sent from SFDC because I checked the email headers. So I think the answer must have something to do with some sort of API / trigger combination. Below is a copy of one of the transfer notifications.

All ideas for making this stop are welcome. Thank you very much.

-Derek

Subject: Contact transferred to you.
Body: Contact [NAME] has been assigned to you. Please click on the link below to view the record.
 
In the session last night, there was a live demo of customizing the hoem page components.  But in TrailHead there's this disclaimer...  "You can’t customize the layout of the Home page, add custom components, or move related lists.", with no follow up about when it will be available like I've seen for other disclaimers.

So what's the real story with customizing the home page?
Hello,

I have a trigger that is changing the owner (After update, After insert)  and each time the owner is change a  notification email is sent to the new owner.

It seems it cannot be disable even with the DML option :

Database.DMLOptions dlo = new Database.DMLOptions();
dlo.EmailHeader.triggerAutoResponseEmail = false;
dlo.EmailHeader.triggerOtherEmail = false;
dlo.EmailHeader.triggerUserEmail = false;
dlo.assignmentRuleHeader.useDefaultRule= false;
database.update(LeadstoUpdate,dlo);

Is there another way to disable this email  ? I found a lot of post asking that but no real solution.

Thanks for your help
  • June 13, 2014
  • Like
  • 2