Skip to main content

Hey SF Community, 

 

I have a trigger in place where if a checkbox is selected on a task, it looks back at a user field on the Contact record.  Then sends the user a notification when the task is updated.  

 

I would like to add some a filter where if the Assigned To ID is the same as the User ID on the contact record to NOT send the notification.  I'm trying to limit the number of notifications since this scenario would be creating duplicate alerts.  I've tried this so far, but it is not working.  Please let me know how best to implement this.  

 

[Task].OwnerId DOES NOT EQUAL [Task].Owner.User.Contact.Marketing_Mgr__c.  

 

Thanks,

Mike 

3 Antworten
  1. 21. Juli 2022, 01:38
    [Task].Owner.User.Contact.Marketing_Mgr__c would be for situations where the owner/Assigned To of the task was a community user (which would then be associated with a contact). I don’t suspect that’s what you’re trying to do. Further complicating this is that WhoId references Salesforce’s “Name” object, which will limit the fields you have (easy) access to. Doing things that rely on something like Who.Marketing_Mgr__c isn’t always as simple as might be expected. To confirm, you’re doing this in an Apex trigger?