You need to sign in to do that
Don't have an account?
Behzad Bahadori 18
Auto populate current UserName after editing an opportunity Field
I have two custome fields in my opportunity. right now the fields are being field manually. one filed is a checkbox, and what I want is as soon as an that check mark is checked, the name of the person that has checked it to be in another field under it . So I have Check1__c being checked,
and I have NameUpdate__c to be field up by my name since I am workign on this opportunity right now
and I have NameUpdate__c to be field up by my name since I am workign on this opportunity right now
1) Create Workflow on Opportunity Object
2) Workflow Evaluation Criteria should be created, and every time it’s edited
3) Workflow Rule Critieria should be Opportunity: Check1 equals True
4) Using field update select this Text field and select formula to set the new value. (Formula: $User.FirstName + ' ' +$User.LastName)
All Answers
1) Create Workflow on Opportunity Object
2) Workflow Evaluation Criteria should be created, and every time it’s edited
3) Workflow Rule Critieria should be Opportunity: Check1 equals True
4) Using field update select this Text field and select formula to set the new value. (Formula: $User.FirstName + ' ' +$User.LastName)
I tried the same code as you provided but it is not working.
trigger populate_current_user on Applications_Time_Tracking__c (before update) {
// populate the current user name on record creation
for (Applications_Time_Tracking__c record:trigger.new) {
record.User__c = userinfo.getUserId();
}
}