25

Your best bet is to refer to the Salesforce api docs. They do a good job of explaining the fields and their possible values. The link to the doc in question is: https://developer.salesforce.com/docs/atlas.en-us.212.0.api.meta/api/sforce_api_objects_user.htm I've included the snippet from the UserType field below. Description The category of user license. ...


21

Actual field names are User.ProfileId and UserRoleId. Assign the strings directly: mike.ProfileId = '00Ee0000000LhpB';


11

Try this trick from http://www.michaelforce.org/blogView?id=a0D3000000AKmy5EAD for changing a user's email address (works in production too): If you change the email address AND check the "Generate new password and notify user immediately" checkbox (all the way at the bottom of the edit screen) then the email address gets committed right away, no ...


10

Couple of options to consider: Throw a Visualforce page into the sidebar component and either update the user record (or directly perform the logic you need to capture "login" event. Have a VF page and set that as the default page for the default App. Everytime the user logs in this page will get executed and then you can redirect to the tab/page that you ...


10

I tried to relate API Name with UI label and here is what I found. Missing field in API but Available on UI Accessibility Mode NewsAllow Forecasting Color-Blind Palette on Charts End of day Force.com Flow User Force.com Quick Access Menu = Make Setup My Default Landing Page Mobile Configuration Mobile Push Registrations Receive Approval ...


10

As of today, there's still no way to do that. You can, however vote on this idea, that's currently on review.


9

I recommend a "maintenance" profile. We have one with all of the login hours set to midnight, preventing users from logging on completely. Another option would be to have your profile set to only show a web tab with your maintenance message. The nice thing about maintenance profiles is that you can mass update all of your users via the Data Loader (just ...


9

It seems you are right, you can't add the button to the layout. This seems to be a special behavior on user, since on other objects it works as you may have noticed. But you can use a custom link instead, which practically does the same, but only looks a bit different and is placed at the custom-links section on the layout. If you are OK with the look, then ...


9

seems like I answered this once before but I can't find it (so, reproducing answer again ... from my Util.cls) private static Map<String,String> localeToDateTimeFmtMap; // Singleton, remember when first referenced // ------------------------------------------------------- // getUserDateFormat: e.g. M/d/yyyy // -----...


8

You can use the new Chatter API in Apex to do this. It's in developer preview currently and is on by default in all Developer Edition orgs. (Note: It went GA in Summer '13.) Here's an example of how to use it: String communityId = null; String feedItemId = 'YOUR_FEEDITEM_ID'; ConnectApi.FeedItem feedItem = ConnectApi.ChatterFeeds.getFeedItem(communityId, ...


8

With V24.0 and higher, certain SObjects used in Org Setup are available to test methods even if SeeAllData=false. From the doc: User Profile Organization AsyncApexJob CronTrigger RecordType ApexClass ApexTrigger ApexComponent ApexPage So, if your testmethod mocks a new user with a nickname already in use, it will be detected as a duplicate. To avoid this,...


7

The license isn't actually connected to the user, but depends on the profile you assign your user. If you create a user with the Chatter Free User profile, the usertype will be set to Chatter free. 5.0 APEX_CODE,DEBUG Execute Anonymous: Profile p = [SELECT id, Name FROM Profile where name = 'Chatter Free User' ].get(0); Execute Anonymous: Execute ...


7

I would suggest that best practice is typically to not re-assign ownership of all records across the board. The fact that a record is owned by a disabled user is not in itself a problem. If you're using that user as a generic "data admin" type user then I'd suggest you create a user for that sole purpose and re-assign all records to that, then you never have ...


7

Not sure if this thread is still active.You can use the login flows. Create a class with an invokable method and refer this class in flow by creating a new flow. Now create a login flow to invoke this newly created flow.


7

How do you setup the schedule to call the batch class? If the schedule is created as part of the package installation (via a class that implements InstallHandler) then it will likely be running as the special installer 'God' or 'phantom' user. This user doesn't exist (or at least is not accessible) in either the packaging or destination org. If this is ...


6

You can create Customer Community User programmatically using apex by assigning Customer Community Profile and set ContactId of the user to account.PersonContactId; newUser.ContactId = account.PersonContactId ;


5

It is not currently possible to create a Workflow to be triggered off the User Record. Its quite a popular idea, so feel free to promote it :) http://success.salesforce.com/ideaview?id=08730000000Br80AAC You can do this using a trigger on User - the bit to send an email would be easy. Identifying all open records would be slightly more difficult, depending ...


5

If the fields that you need to add have a direct 1:1 relationship with any given user, I would say add them to the User object directly and possibly create a new Section on the page layout to house them. The other thing to consider is that you can't have the User as the Master in a Master/Detail relationship you can only specify a lookup. If you create a ...


5

From my experience, accessing direct group members isn't too bad - you just iterate the group and for all user members just pull their details. If it is a group member, you just recursively call your function that iterates the group. Where things get really sticky is when you try to figure out the indirect members - I've found that when you start trying to ...


5

Nope. You could add an external Id on the user record and then upsert if you're trying to load records. Or perhaps add a custom setting to store their Ids access multiple environments if you need to access that data through Apex.


5

This code couldn't be correct. The Tips for Using Salesforce to Salesforce document that Phil R linked in the original question comments refers to pnet being embedded in the alias, while this code checks the User.Id field for those characters, which has an incredibly low probability of appearing. Either it's meant to work in a single organization where a ...


5

The 'Accessibility Mode' is a common feature in not just Salesforce Calendar but several other solutions which provide support for specially challenged e.g. for blind or visually impaired people. The 'Accessibility Mode' allows these people to read and interpret the provided information either by converting text to speech or providing other helpful clues. ...


5

Those who thinks that this Delete feature is required for Deleting unwanted user details from Salesforce please click on below Link to Vote for the Idea. Currently this Idea is under "PRODUCT TEAM REVIEW". I believe this is a cool feature that all Admins required now or in near future. Click to Vote for this Idea Attaching a screen shot of this as below.


5

You can refer Determine User Visibility in Your Community User sharing lets you decide whether all users in a community are visible to each other. User sharing for external users is turned on by default when you enable Communities. This setting applies to all communities in your organization. The default setting allows an external user to see other ...


5

Whenever you subscribe to platform events in SF via Flows, Process Builder or Trigger.. the logic/code runs in the context of Automated Process. From Docs: Platform event triggers/flows/process run under the Automated Process entity. Also as its Automated User, it does not have session ID and Email Address and thus Sending an email message from a ...


4

Tim Smith's excellent answer already covers the User Types that are currently documented by Salesforce, so I'll focus on the "undocumented" ones. This screenshot was taken from a picklist lookup, triggered from the List View customization screen for the User object. It should be a complete list of all User Types as of Spring ’14. Comparing this list to ...


4

Yes your salesforce username has to be globally unique. I would think the Community Nickname is only unique across your org. You might also want to review this thread Handling Community Nickname field for Customer Portal registration


4

What other information are your users entering? Could you do combinations? FirstNameLastName_Zipcode or something like that? Or include the email domain?


4

As you say the field is unique but does not apply to Portal customer. Given this we are using the SFID for the contact. We know it is unique by design and saves retrying for erros


4

My initial thought would be to check Field Level Security. Just because you are an admin doesn't mean you have the proper field level security for all of those fields. It still needs to be enabled for the field for the System Administrator profile to view. Outside of that, this should work. I quickly tested it in a development org and I was able to properly ...


Only top voted, non community-wiki answers of a minimum length are eligible