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
a.schaefera.schaefer 

insert default value for related lookup?

I recently learned that
"When you enter or select a contact for the Contact Name field, the Account Name field defaults to the account associated with the contact when you save the case. However, you can change the account in the Account Name field during subsequent updates."
Is this functionality available to other objects e.g. Opportunities or even better Custom Objects? And how would one implement it?

Thanks in advance,
Andreas
werewolfwerewolf
Not out of the box, but it's easy enough to do at save time using an Apex trigger.  If you have a Contact lookup, just use your trigger to look up the corresponding account and update the object accordingly.
a.schaefera.schaefer
thanks for your reply - i understand how to achieve this programatically, i was just surprised that it seems to be a limited feature that would be wonderful and easy to use on a larger scale i.e. on other Objects.

cheers, Andreas