Questions tagged [user-record]

This Tag is used to group all queries related to Salesforce user Record

Filter by
Sorted by
Tagged with
13
votes
3answers
7k views

Execute an action / run a trigger every time a User logs in to Salesforce

Is there any way to consistently execute a piece of Apex code whenever a User logs in to Salesforce? Posts such as this one seem to suggest that triggers on updates to the User object's 'LastLoginDate'...
21
votes
4answers
24k views

What are the possible options for UserType?

The Salesforce docs describe the UserInfo.getUserType() call, which returns the same options as user.UserType. But I can't figure out where to find a list of the possible return values. Please ...
2
votes
3answers
5k views

Get dateformat based on Locale

i am trying to fetch the date format for the logged-in User in javascript on visualforce page. Usually I used to get this data by using: window.UserContext.dateFormat Expected Output should be: "...
7
votes
1answer
1k views

Different user IDs across production and sandboxes - how to make them the same for every user?

Normally users across production and sandboxes have the same unique user ID, given that you created the production user first, and then refreshed the sandbox. We have the case that we created users ...
10
votes
6answers
3k views

Handling Community Nickname field for Customer Portal registration

We have a customized Force.com Site + Customer Portal for the authenticated portion of the Force.com Site. We have self registration enabled. Currently the nickname and alias fields are required on ...
5
votes
1answer
2k views

Retrieve UserId of @mention user from chatter post in Apex

Is there a way to retrieve the user id of @mention user from chatter post in Apex? We can write a before insert trigger on feeditem, but when we display the body (which has @mention user) it simply ...
8
votes
1answer
10k views

Creating a user with DML

I have the following Apex code: User mike = new User(); mike.Username= 'mike.white@company.com'; mike.Email = 'mike.white@company.com'; mike.Lastname = 'mike'; mike.Firstname = 'white'; mike.Alias = '...
2
votes
2answers
2k views

Evaluate the current User in a visual workflow

I created a Visual Workflow that launches after a user clicks a custom button on the Account page. I'm wondering if I can use Decision logic to evaluate certain attributes for the logged in user and ...
5
votes
1answer
3k views

How to enable customer community users via apex

We have person accounts in our org. to whom we need to give access to our customer community at various stages of an opportunity. Is there a way we can programmatically enable our person accounts as ...
4
votes
2answers
275 views

Is there a way to access all user info?

Is there a way to get a drill down through DB/reports all the info related to an user like permission set sharing settings active/inactive( I can get this by Isactive filter) what public groups he/...
4
votes
1answer
857 views

Invalid field Username on User : SOQL Query

I simply cannot understand the reason why I am getting this below error. 17:16:15.106 (1106785435)|SYSTEM_METHOD_EXIT|[29]|system.UserInfo.getUserId() 17:16:15.107 (1107062779)|EXCEPTION_THROWN|[29]|...
2
votes
0answers
247 views

INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY on Communities Change Username Page Test

I created a visualforce page for Communities users to update their username and email. In real life the page works fine, logging in as a Community user I can update my username and email. However, I ...
2
votes
2answers
2k views

create user in trigger of contact

Please help me as I am new to salesforce. i want to create a user record when a contact is inserted. Not all contact but contact which are being converted from lead. i have created a custom checkbox ...
2
votes
2answers
824 views

Evaluate Current User for Flow - 15 - 18 digit User ID

I need to evaluate the current user running a flow. Someone suggested I use the Global Variable {!User.Id}, but it's returning a 15 digit Id. I need to compare the current user with the Account owner. ...
0
votes
1answer
107 views

Exception email alert cites a UserId that doesn't exist in my org

I wrote an apex service (called by my Account Trigger before insert and before update) that runs some complex validation , and it starts by querying for the user record of the running user since the ...