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

"Last Modified By" with an Integration

I'd like the "Last Modified By" on a record to show as a person instead of an integration user.  This is a good idea in general, and with Chatter coming out it'll even be a better idea.  Here's some brainstorming on how, and I'm hoping someone has some ideas either new or how to make these existing ideas below to work.


Pass in the user for each record somehow when doing an API upsert

Is it possible though API to post a record update as a specific user?  I remember reading somewhere that you could have something like this enabled on your salesforce org for initial data loads to specify "Created By".  Perhaps whatever that is could be permanently enabled?


Pipe in the changes to a custom object via API and then somehow use Apex (or Workflow) to post them to the real object as the person user

Is there any way to post a transaction in Apex as a specific user?  I looked at using runAs but apparently thats only for test methods.


Do API upsert with the user's actual username, password, and token

But if I manually gather these passwords, how do I block users from changing their password/token; or alternatively retrieve them reliably via Apex or API with a System Administrator user?


I'm suspecting there isn't really a good workaround, but I wanted to ask the forum before giving up.  Thanks in advance for any input.


Upon further thought, I'm thinking doing an API upsert with the actual username and password might work.


We could avoid the token I think by setting an IP whitelist, and if anyone changes their password without going through appropriate channels we can change it back I think with Apex's System.setPassword(user,pw) 


It'll be transaction inefficient somewhat separating the transactions by user and a pain for the users to have their password locked down, but it might be worth it to have "reality" as far as who is making what changes.


Anyone have any thoughts?