1

As a System Administrator, if I use the 'Log in to Community as User' functionality from a Contact record to access the Community:

log in to Community

Is there any way of knowing who that system administrator user is during the time they are logged in as another user? For example, users are able to create a record through the Community and I would want to know that Billy Bob (the contact/community user) is the creator/owner and that John Doe is the system admin who is logged in as Billy Bob (and be able to set John Doe in a user lookup field during the record creation process).

1

Currently there is no direct way to achieve this, however you can build your custom solution. In Winter 16 - SetupAuditTrail is available as an Object and we can use SOQL against it. It's same data, we were accessing it using "View Setup Audit Trail" menu from setup.

Sample SOQL -

SELECT Action,CreatedById,CreatedDate,Display,Id,Section 
FROM SetupAuditTrail Order by CreatedDate DESC

we can add condition for Section = 'Manage Users' in SOQL query. You might want to play with it using workbench or Developer console.

  • Interesting, I was not aware of that enhancement. I'll dig into this a little further. Thanks for the insight. – John_Henry Dec 1 '15 at 14:24
  • I looked into this and it doesn't appear you are able to query for the user that is being logged in as. Both CreatedBy and DelegateUser (although I don't know that this field is working correctly) appear to return the admin performing the action. – John_Henry Dec 1 '15 at 15:49

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.