0

I have a date field that, when changed, I'd like for an update to another field specifying which Salesforce User made that change. Would the best way to go about this be a Workflow Field Update? How can I create the field update to a lookup field? Essentially, when this date field is actioned, I'd like for the secondary field to have the User's First and Last name populated in it and linked to their User Profile, as any lookup would be.

The basis of this request is we want that when a specific person (one who has permission) edits a field on the custom object, that the date and that User's name is captured. This would ideally be similar to the Last Modified by field, but only for certain users.

  • The basis of this request is we want that when a specific person (one who has permission) edits a field on the custom object, that the date and that User's name is captured. This would ideally be similar to the Last Modified by field, but only for certain users. Thank you. – Tamim J Aug 6 '15 at 15:40
  • 1
    Field History Tracking would give you this information for no work. There isn't a specific lookup to the user that changed the field, but it will be shown in the audit table. Just a thought... – Richard Durrant Aug 6 '15 at 16:10
  • That works, but if there is a cleaner solution, I'd prefer that. – Tamim J Aug 6 '15 at 16:30
  • That's about as clean as it gets and is built-in functionality of Salesforce. The added look-up field would change via workflow with every update, so what would it's purpose be or what would it accomplish for you that History Tracking wouldn't? – crmprogdev Aug 6 '15 at 16:32
  • It would accomplish a nice, clean, reportable and easy way for others to see who last reviewed that date field. – Tamim J Aug 6 '15 at 19:03
-1

As mentioned in the comments, the Field History Tracking is salesforce built in way of handling this. However, if that doesn't give you exactly what you need, you could write a trigger to work the way you explained above.

  1. Add trigger to object On Update
  2. compare the values of the field in Trigger.OldMap vs Trigger.new
  3. If the field has changed, then store the current users Id in the desired field
  4. Use a map to track with records you have processed and prevent recursion
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.