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
SubhamSubham 

Filter based on look up value

Hi All,

 

I have two field on account.

One is look up to the user and other is a custom field.

 

Requirement is something like this:

When i select user A then immediately Custom field should be populated with His manager name.

This requirement is same as below.

Custom field on account can be picklist also and value withing this can come from say a custom field from user

 

Regards,

Subham

 

nagalakshminagalakshmi

hi,

 

write a trigger for getting the manager name based on the user id i.e which user is selected in account.

 

Thanks

SubhamSubham

Thanks naga.

can you share code snippet

 

Regards,

Subham

nagalakshminagalakshmi

Hi

 

try this. Just i have write the code.I have not executed this. let me know if any issues.

 

trigger retailbrandlink1 on account (before insert,before update)
{
id uid;
for(account a;trigger.new)
{
uid=a.user_field;
user u=[select id,manager from user where id=:uid];
a.customfield=u.manager;
}
}

 

replace the fields with u r fields.

 

Thanks