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
grandmastergrandmaster 

How to retrieve a user with a specific role from Account Team Member ?

Hello

 

Say a user 'John' has a role 'X' and is set as an Account Team Member for an Account (say ABC Corp), who has a contact 'Mark Twain' .

 

I want to pull the value of the username with a role 'X' in the Account Team of an Account, and then consequently display it in a custom text field CF__c in the Contact object.

 

In short, I want to display username of John in the CF__c of the contact Mark.

 

Is there a way using a formula, I can set the CF__c?

 

Thanks

 

Best Answer chosen by Admin (Salesforce Developers) 
AroraAnupAroraAnup

Doesn't look like you will be able to do so using a formula field. Since you want to query the Account Team Member object (which is at the Account level of the Contact) and bring over the Team Member (User) username at the Contact record, there are multiple tables involved here and a formula field will not do the trick for you.

You would need to write a trigger in order to bring over the username of the Account Team member into this CF__c field on the Contact.

 

Hope this helps!

All Answers

AroraAnupAroraAnup

Doesn't look like you will be able to do so using a formula field. Since you want to query the Account Team Member object (which is at the Account level of the Contact) and bring over the Team Member (User) username at the Contact record, there are multiple tables involved here and a formula field will not do the trick for you.

You would need to write a trigger in order to bring over the username of the Account Team member into this CF__c field on the Contact.

 

Hope this helps!

This was selected as the best answer
grandmastergrandmaster

Thank you CloudKinght. Even I did some research on this and concluded the same. Your inputs further solidify my conclusion.

 

Cheers!

 

gm

Xavier Vincent 8Xavier Vincent 8
Hi everyone,

Did someone find a sustainable answer for this specific problem ?
I'm facing exactly the same issue and I can't find any answer anywhere.

Thanks for your time !

​Xavier