function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Apollo-AndyApollo-Andy 

Compare account owner to activity owner

I want to add a formula custom field on the activity object that compares the activity assigned to (owner) with the Account owner (if available) and return True if they are the same and false if they are different. Any thoughts
Suresh RaghuramSuresh Raghuram

IF( activity assigned to (owner) = Account owner (if available), true, false)

Apollo-AndyApollo-Andy
None of these fields are available
Suresh RaghuramSuresh Raghuram

Then you should rely on Trigger.

Shannon HaleShannon Hale

You're not going to be able to do this with a formula right now. The "What" field (the record that the activity is associated with) isn't available in formulas. The reason is that "What" is a polymorphic field -- it could be an Account, Contact or several other objects.

 

My team did the infrastructure to support polymorphic fields for the Summer '13 release, but we don't yet support all the polymorphic fields (the only one we exposed in Summer '13 is the Owner field). So you'll need to use a trigger to do this at the moment. I don't know right now when What will be supported; that will be up to the Tasks team.

sandeep@Salesforcesandeep@Salesforce

You need to write this logic in Apex code like Trgger.

AroraAnupAroraAnup

WHATID field is not available for formula fields. The only workaround for this would be to write a Trigger that checks the Activity Assignee and Account Owner and returns TRUE/FALSE as per the criteria.

Hope this helps!