You need to sign in to do that
Don't have an account?
Zhenyu Liu
Trigger to update lookup field with the value put in specific field
Hello Team,
I am not a developer and I do not yet write Apex code very well. I need an Apex Trigger to do the following:
whenever user put a value in the Change_Manager_field__c field which in User object, the manager field (standard field) need to be upated to the value which put in the Change_Manager_field__c.
Thanks in advance.
I am not a developer and I do not yet write Apex code very well. I need an Apex Trigger to do the following:
whenever user put a value in the Change_Manager_field__c field which in User object, the manager field (standard field) need to be upated to the value which put in the Change_Manager_field__c.
Thanks in advance.
Yes you need to assign the managerid. Use the below code: Let me know, if you need any other help.
Thanks,
Neetu
All Answers
I am supposing that your custom field is also a look up to User. Use the below code: Let me know, if you need any other help.
Thanks,
Neetu
Thanks for your response, but after I put your code. it shows "Error: Compile Error: Illegal assignment from Id to User at line 6 column 13". The Change_Manager_field__c and manager field are both lookup to User.
Thanks
Zhenyu
Thanks,
Pramodh
Yes you need to assign the managerid. Use the below code: Let me know, if you need any other help.
Thanks,
Neetu