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
ne-rm-teamne-rm-team 

catch a user field from an opportunity

Hi,
 
i'm trying to catch the user field $User.Division depending on the owner of the oppotunity. The new cross object formulars doesn't work in this case. So i thought about the possibility to catch this field with an little apex programm.
 
The problem is - i'm totaly new to this programming language. So my question is - where i can find some examples, tutorials or other helpfull stuff?
 
Thanks in advance for any help.
 
With best regards
Sascha
werewolfwerewolf
What do you mean, you're trying to catch that field?  Catch it and put it where?
ne-rm-teamne-rm-team
in a custom field of the opportunity!
 
the field opportunity owner has a relation to the object user. from there i want to display the user division of the opportunity owner in the opportunity.
werewolfwerewolf
So then you don't want $User.Division, you want Owner.Division, right?  $User is the currently executing user.  Owner is the actual lookup from Opportunity to User.
ne-rm-teamne-rm-team
Yes. I think i discribed it a little bit wrong. The Owner of the Opportunity has a lookup to the a user record and from there i whant the division. That's in fact in other words the Owner Division. I dont't whant the Division of the User that is actually in that session.