Questions tagged [user-record]

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

Filter by
Sorted by
Tagged with
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 ...
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'...
13
votes
3answers
7k views

List of User fields not available in Apex

I am looking to write some custom functionality for creating a User. The problem I am facing is that some of the standard User fields don't appear to be available through the API. I found this Idea ...
12
votes
2answers
4k views

Deleting Users from Salesforce permanently

Its been quite while that a large number of Users were Deactivated and not need them anywhere in ORG. And the user list who were deactivated getting piled up to a heap now. Couple of users never ...
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 ...
9
votes
1answer
902 views

Do not send email when activating a user

I'm writing some code that should (de-)activate some users based on some criteria. This part was easy, but one of the requirements is also that this user should NOT get an email. So when I create a ...
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 = '...
7
votes
1answer
2k views

Why would my test class throw a Duplicate exception?

I have a test class. The annotation on the class is @isTest(SeeAllData=false) In the test, the first step I do is create a user. I am getting the following exception when I run my test. System....
7
votes
5answers
2k views

Can users be stopped from editing their own user record?

Is there any way to restrict a user from updating their user details (first name, last name, email etc...)? Revoking CRUD access to the user object does not stop this. Currently users can navigate to ...
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 ...
7
votes
2answers
2k views

User Trigger while changing the Chatter Profile Picture

The chatter profile picture url is saved in the User FullPhotoUrl field. If we try to modify the picture/upload a new picture in the chatter profile image, the trigger in the user object is not ...
6
votes
2answers
4k views

Add a button on User detail page

How to add my custom button on User detail page? I've created a VF page with User standardController. I've created a button in "Edit User Custom Button or Link". This button appears in layout. But I ...
6
votes
5answers
1k views

Best practice for removing former admin user from all records, triggers and workflows?

I'm thinking of using demandtools to find all objects that their account is tied to. Then I was going to test removal and replacement with current admin user in a sandbox environment. Just wondering ...
6
votes
2answers
900 views

Can community user query internal users of salesforce

I am running a trigger whenever a contact is edited. In trigger I am querying user [Select id from user] I am getting all the users when trigger in run in any internal user context. But when same ...
6
votes
1answer
3k views

userinfo.getuseremail() returns noreply@salesforce.com in salesforce

I have created a package in salesforce that will make an http callout request with user's email id to get data for that email and add the data to some custom object. But when I tried using UserInfo....
6
votes
1answer
251 views

Opportunity.LastModifiedBy is null

I found reference to an invalid user in a sandbox yesterday: LastModifiedById on an opportunity had a Salesforce ID that was not available in the org, and opp.getSObject('LastModifiedBy') returns null....
6
votes
1answer
1k views

New Customer Portal user email even when triggerUserEmail = false

I'm trying to write an Apex web service that can create a customer portal user. After creating the user, there is a separate step which does a password reset for the user and sends them an email. The ...
6
votes
1answer
255 views

Make packaged test classes which definitely don't fail

I am writing test classes for a managed package which should work in any org. However, for my tests I need to create a test user and I know this can fail in orgs which, for example, have mandatory ...
5
votes
1answer
1k views

Prevent majority of users from logging in (+ notification)

I am looking for a way to prevent users from logging in in a certain time span, let's say for a few days after new year's eve to check all data in the system. I thought about the "Login Hours" on a ...
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 ...
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 ...
5
votes
1answer
564 views

Developer console updates current user's User record

We have noticed that Developer Console does some kind of an update on the current user's User record. When that happens, our User trigger is invoked, but with what seems limited permissions, and we ...
5
votes
1answer
491 views

How to Store data as per role Hierarchy and hierarchical Rollup in SFDC

I Need to Store Number fields per used based on User role Hierarchy and need to do hierarchical Rollup later on once data is updated. Did anyone tried to do this in Salesforce. One Approach I am ...
4
votes
2answers
7k views

how to change email of user in sandbox to something like .sandboxname?

I tried to change an user's active email in my sandbox(Sandbox name:stage) as they didn't want to get further notifications for the actions that we are doing in our environment from : abcd@gmail.com ...
4
votes
3answers
4k views

Can I assign Permission set to a profile instead of user?

I knew that Permission set can be assigned to User record. But just want to know the possibility of assigning the Permission set to a Profile instead of user. I saw some query related to this posted ...
4
votes
2answers
4k views

What could be the situation - Record Currently Unavailable- Record Lock Issue

One of user from my org got this error while changing an owner of Account. (there is a trigger on Account who updates its child opportunities too ) Now I am unable regenerate the error. So my ...
4
votes
2answers
2k views

Can a Workflow Rule be created against a User Record? i.e. send an email alert to their manager once the record is deactivated?

We would like to have an email alert sent to the manager of the departed employee once the user record is deactivated. In that email, we would like to include a link to all that employee's open ...
4
votes
1answer
168 views

Does 'pnet' in a user's Id have any special meaning?

I am working on an app and in one of the triggers there is this exotic bird: if( UserInfo.getUserId().indexOf('pnet') != -1 ) { return; } Looks terribly hard coded or is there a general rule ...
4
votes
1answer
5k views

Are lookup fields on the User object (e.g. to Contact) supported by the platform?

Aim – i need to have a lookup field on the user object which looks @ the contact object and only returns values where the email address is @domain.com Now i am under the impression that no lookups ...
4
votes
3answers
6k views

Avoiding the password notification to be sent to the User on creation

When i create new user through salesforce UI i dont want the password notification to be sent to the User .Is this possible ?I know one solution is to uncheck the generate Email Notification and new ...
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]|...
4
votes
0answers
150 views

Purpose and/or Description for “Is Controlled by System” Field on User Record Requested

I was working on a Validation Rule today for User Records, and notice a field on the User Record "Is Controlled by System",. This looks promising and useful, however, I can't seem to find anything ...
4
votes
3answers
167 views

Detect and eliminate existing duplicate accounts, contacts and Opp for Professional Edition

I am using SF Professional edition have been Searching a free app to detect and eliminate the duplicates mainly for the Accounts, Contacts and Opportunities. Most of the free apps tends to search ...
3
votes
1answer
1k views

How can I create a Chatter Free License user in a test class?

I am trying to create a user in a test class and this user needs to be a Chatter Free License. Usertype is the field to set the license but this one is not writable. Any pointers on creating a user ...
3
votes
2answers
667 views

User Community Nickname

Community Nickname has to be unique across all users? or it has to be unique within a org? As far as I know, username has to be unique across all Salesforce users in the world. Any thoughts?
3
votes
1answer
87 views

How can I get an overview of a users ownership and usage?

I am trying to get an overall view of a users ownership in SF. e.g. - How many accounts/leads/opptys a certain user has. I wanted to use rollup summary, but can't. In the user's page, all I see is ...
3
votes
2answers
2k views

Can the User's Last Login date be used in a formula?

I need to calculate the LastLoginDate - Created Date of Users in a formula field. The Last Login Date field is not available here.. Is there a way to get it without having to write code/SOQL?
3
votes
1answer
588 views

Processing only new records in a batch apex

I want to process only the new records in a batch Apex. We can query the new records in a trigger by Trigger.new . Is there any means by which we can query only the newly created data items and ...
3
votes
1answer
570 views

Render a tab for certain public groups

I have a custom page that overrides the default account page, dividing it into multiple tabs. I was wondering if there was a way to use the "rendered="{!IF($.........." to make the tab available to ...
3
votes
1answer
810 views

access records based on user id - roles setup

I am new to Salesforce, and need an advise. We are planning to create a custom object and custom tab for it. Now, we want user to be able to access only his/her record, or records related to him. For ...
3
votes
1answer
37 views

Show View State checkbox on User record is missing

I have one client where the "Show View State in Development Mode" checkbox field is missing on the User detail screen, so I can't enable View State. The user has a full Salesforce license and is a ...
3
votes
0answers
109 views

How to set up a test user in a unit test that invokes a callout from a future method

I want to do the following in a unit test: Create a test user to invoke System.runAs with Update a case record and then invoke a future method that has a callout in it Check the result Turns out I ...
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: "...
2
votes
3answers
10k views

How do we get all the users who are part of public group of current logged in user?

I want get a list of all the users who are part of public group of the currently logged in user. From what i have read on the documentations, i should be able to pick these values from group and ...
2
votes
1answer
677 views

Documentation: Automated Process user/proxy user

I wanted to read more about the Automated Process user and what processes go through that user but I cannot find a salesforce's documentation page. Can somebody provide me with a link? I also read ...
2
votes
2answers
1k views

Using {!User.FirstName} in Email template aiming for User object but return current user

I have an Email triggered on User object and want to say Dear User.FirstName something something. In the merge field for Email template, User.FirstName will only reference the current User's first ...
2
votes
2answers
426 views

Whait is the use of the managerId on user

What is the use of the managerId on the user object ? Can it control visibility of data without explicitly generating sharing manually for the manager?
2
votes
2answers
5k views

Mysterious OP_WITH_INVALID_USER_TYPE_EXCEPTION, Operation not valid for this user type: []

I had following situation. When I tried to edit and save some of custom object CustomObject1__c instance, I received error in the top of the page Error: Invalid Data. Review all error messages below ...
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 ...