You need to sign in to do that
Don't have an account?
Robert Wambold 10
Trigger to update User Profile
Hello,
I have a simple trigger to update a few custom fields on the User Profile Object. Not sure what is missing...I want my trigger to fire when the User Profile is updated.
Thanks for your help!
trigger Update_User_Custom_Fields_Trigger on User (before insert, before update) {
for(User u:trigger.new){
u.Last_Login_for_PB_Flows__c = u.LastLoginDate;
u.Managers_Email_for_PB_Flows__c = u.Managers_Email_del__c;
u.AboutMe = '*** This is a Test ***'
}
}
as a trigger, it works. Did a quick test in my test env: The above works - i didn't test your custom fields.
When you say it doesn't work, what do you mean? it doesn't fire? it updates some fields but not others?
Perhaps just check that the Trigger is active.
Regards
Andrew
All Answers
as a trigger, it works. Did a quick test in my test env: The above works - i didn't test your custom fields.
When you say it doesn't work, what do you mean? it doesn't fire? it updates some fields but not others?
Perhaps just check that the Trigger is active.
Regards
Andrew
When you said user profile, you mean user records ? or profile record?
User record.
Trigger is active.
Update your trigger with some debug lines and turn on the debug logs and then test and review the logs. Confirm that the trigger is being invoked and that the loop is happening.
Regards
Andrew
My Custom Fields were the prodblem. Thank you both for taking time on a Sunday evening.
Kind regards,
Robert