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
thuskerthusker 

Any way to "translate" the Opportunity Owner ID to the actual Name on a related Object?

Could use a little help here from the masters on this board . . . we have a discount approval process that uses an Object related to Opportunities.  Our order management folks really want the Opportunity Owner's name to be reflected on the Object itself (Approval Request Form).  Looking at the Opportunity itself is apparently too hard or requires extra steps.  Whatever!

 

Anyway . . . seems like it should be an easy thing to do but all I have been able to do is create a formula field that can pull in the Opportunity "Owner ID"--which means nothing to the people who need to see it.  I really need a field that can automatically show the actual Opportunity Owner Name in text on the Approval Form so order management can see "Bob Smith" instead of "00530000000diZm".

 

 

I'm sure there is probably something simple I am missing.  But how in the world do I get the name to show up in a field on that Approval Form?  Is there a formula function that "translates" the ID and can do that?  I'm pretty stumped.

Best Answer chosen by Admin (Salesforce Developers) 
rjheiserjheise

This solution did work for me.

 

I was able to create a custom object that referenced an account field that tied to the account owner.  In my case, it was a region field.   My custom object called Region had one additional custom field called Sales Manager.  I changed the Name field to Region.  I then populated this object with the regions and sales managers that are tied to them. For me, these sales managers are the same as the owner of the account.

 

On my account object, instead of the region field being a text field, I made it a lookup field to my custom region object.

 

Now, on any of the related lists to account (opportunity, contracts), I can create a custom formula field that will look into Account > Region > Sales Manager to show the name of the sales manager from the account.

Message Edited by rjheise on 12-08-2009 08:20 PM

All Answers

Steve :-/Steve :-/
What is the relationship between the Opportunity and your custom object?  Is it Master-Detail or Lookup?
thuskerthusker
It's a Master-Detail relationship.
Steve :-/Steve :-/

Man...  you wouldn't think this would be that tough, but it looks like even with Master-Detail you can't get a handle to the Owner Name using formula language.  

 

This is definitely one of those WTF?!? moments 

 

I'm gonna another crack at it and see if there's a way around this, I'll keep you posted.  

thuskerthusker
LOL . . . yeah, I agree.  You'd think that this is something the system would be able to do pretty easily.  Apparently not.  Thanks for taking a stab at it!
SueHallSueHall
Same issue here...love to see if it can be done!
alexcfalexcf
Yep, needing to do the same thing... Can't see a sensible way of doing it. I'm new to all this Salesforce stuff, so probably missing a few tricks. :)
rjheiserjheise

I have the same issue -

 

I am trying to display the name of the account owner in a contract field.  I can display the ID in a formula field, but can't translate to the name.

 

Only thing I can think of is to create another object that is linked to the contract in some manner that will have a field with the owner name that I maintain.  For example, if I have an object that includes a region number linked to the account, and that object also lists the user name assigned to that region, I may be able to create the formula field that ties from the account to that object field.

 

I'll let you know if that works - or if anyone has something easier that uses the existing objects, let me know.

 

Thanks,

 

Robert

rjheiserjheise

This solution did work for me.

 

I was able to create a custom object that referenced an account field that tied to the account owner.  In my case, it was a region field.   My custom object called Region had one additional custom field called Sales Manager.  I changed the Name field to Region.  I then populated this object with the regions and sales managers that are tied to them. For me, these sales managers are the same as the owner of the account.

 

On my account object, instead of the region field being a text field, I made it a lookup field to my custom region object.

 

Now, on any of the related lists to account (opportunity, contracts), I can create a custom formula field that will look into Account > Region > Sales Manager to show the name of the sales manager from the account.

Message Edited by rjheise on 12-08-2009 08:20 PM
This was selected as the best answer
utahTopherutahTopher

I needed to do the same thing. I created this simple account trigger:

 

 

trigger setAccountOwnerName on Account (before insert, before update){

 

Map<Id,String> userMap = new Map<Id, String>();

 

for (User u : [Select Id, Name From User]) {

userMap.put(u.Id, u.Name);

}

for (Account a : Trigger.New) {

a.Owner_Name__c = userMap.get(a.OwnerId);

}

}

 

 And the test:

 

 

@isTestprivate class Test_setAccountOwnerNameTrigger {

static testMethod void myUnitTest() {

Account acct = new Account(LastName = 'fooLastName');

insert acct;

system.assertequals(acct.Owner.Name, acct.Owner_Name__c);

}

}

 

 Now I have a formula field on my custom object that displays the name of the account owner.

 

 

max4904max4904

I've read this a couple times and I don't understand exactly what you did to translate the ID to a name.  Would you mind clarifying it for me?