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
SDixonSDixon 

Changing the Lookup for Contact Owner

Hello,

 

I'm new to this site (well SFDC in general).  The company that set up the system for us isn't very helpful, so I was hoping that someone here could help me.

 

For 2010 I did a mass re-allocation of our accounts, but I soon realised that I would have to set a separate mass change for both Contact & opportunity as the record owners for those do not lookup to the account record owner.  (We want the Contact Owener, Account Owner, & Opportunity Owner to all match)

 

Is there any way to change it so Contact Owner will lookup to account object and bring back the account record owner instead of looking up to the user object?

 

Thanks,

 

Stacy

Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/

You can't force that kind of cascading inheritance on your existing records, but you can write validation formulas to enforce the rule going forward.  

 

Something like this

OwnerId <> Account.OwnerId

 

 

 

 

For your existing records you're probably going to have to do a Mass Export of the Account, Contact, and Opportunity tables using the Force.com Data Loader.  Then in MS-Excel using your Account extract table as a Master perform a VLOOKUP to replace the Contact.OwnerId and Opportunity.OwnerId in your Contact and Opportunity extract files.  Then reload them using the Update function in the Force.com Data Loader.  

 

After that you should be good to go. 

All Answers

Steve :-/Steve :-/

You can't force that kind of cascading inheritance on your existing records, but you can write validation formulas to enforce the rule going forward.  

 

Something like this

OwnerId <> Account.OwnerId

 

 

 

 

For your existing records you're probably going to have to do a Mass Export of the Account, Contact, and Opportunity tables using the Force.com Data Loader.  Then in MS-Excel using your Account extract table as a Master perform a VLOOKUP to replace the Contact.OwnerId and Opportunity.OwnerId in your Contact and Opportunity extract files.  Then reload them using the Update function in the Force.com Data Loader.  

 

After that you should be good to go. 

This was selected as the best answer
SDixonSDixon

Thanks!  That formula is Spot on!!

 

I completed the mass changes earlier this week, and now I'm glad to know that I did the right way :-)

 

You are a star, and have saved me a lot of time in the future.

 

Very much appreciated!

Steve :-/Steve :-/
No problem Stacy, that's why they pay me the BIG bucks! ;-)
SDixonSDixon
Well, as long as your answering, I'll keep asking, then maybe I'll know enough to make the big bucks too lol
Steve :-/Steve :-/

Actually it's more like the Big Pesos...

but it could be worse, the Italian Lira wasn't doing so hot the last time I checked. 

 

 

mmrrmmrr

Hi,  I see your valuable contributions to our community, thanks!  Is there by anyway we can change the Opportunity Owner ( which is a lookup to user) to be defaulted to the contact of the Opportunity.  Please help me on this.

Steve :-/Steve :-/

I'm not sure I follow what you mean.  The records in SFDC are owned by User not Contacts.  Can you explain exactly what you're trying top do and what your requirements are?

mmrrmmrr

The opportunity owner has a lookup to Users.  My requirement is that the Opportunity owner should be the Contact owner always and not the user.  Is this possible?

Steve :-/Steve :-/

How are you linking the Opportunity to the Contact?  There is no direct link between them out of the box in SFDC

mmrrmmrr

If I wanted to link that through the AccountId of the Opportunity, is that
possible?

Steve :-/Steve :-/

Sorry, I still don't get what you're trying to do.

mmrrmmrr

Thanks for your replies.

I want the Opportunity owner to be Opportunity.Account.Contact for all the Opportunities created, is this possible by trigger or any other logic?