13 votes
Accepted

Deleting Users from Salesforce permanently

As of today, there's still no way to do that. You can, however vote on this idea, that's currently on review.
Fernando Gavinho's user avatar
11 votes
Accepted

Get dateformat based on Locale

From my Util.cls: private static Map<String,String> localeToDateTimeFmtMap; // Singleton, remember when first referenced // ------------------------------------...
cropredy's user avatar
  • 70.8k
11 votes
Accepted

Error when adding Role to my user in a scratch org

This is a pretty common issue with scratch orgs, particularly if your org is generated with hasSampleData: false. It comes up any time you assign one of the built-in Roles to any User and it's always ...
David Reed's user avatar
  • 92.6k
9 votes

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

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 ...
Sachin SB's user avatar
  • 101
8 votes
Accepted

Documentation: Automated Process user/proxy user

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 ...
Pranay Jaiswal's user avatar
5 votes
Accepted

No such column 'ProfileId' on entity 'User' when try to do SOQL query using Community Plus User

According to Salesforce documentation: Profile Represents a profile, which defines a set of permissions to perform different operations, such as querying, adding, updating, or deleting information. ...
DavidSchach's user avatar
  • 5,874
5 votes
Accepted

Assign role to user in Apex

You're trying to assign UserRole to UserRoleId - trying to assign sObject to Id. Correct code would be: user.UserRoleId=[select Id from UserRole where Name = 'CEO'].Id;
EvAzi's user avatar
  • 1,041
5 votes
Accepted

Can someone please tell me more about the 'Accessibility Mode' mentioned in User Record?

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 ...
Gaurav Kheterpal's user avatar
5 votes

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

AFAIK the platform has no direct support for this. But you can write workflow logic or trigger code to add/delete the PermissionSetAssignment objects automatically based on attributes of the User ...
Keith C's user avatar
  • 136k
5 votes
Accepted

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

We can not able to assign Permission set to Profile. We need to assign it to a User only. A permission set is a collection of settings and permissions that give users access to various tools and ...
Devendra's user avatar
  • 5,075
5 votes
Accepted

Can community user query internal users of salesforce

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 ...
Santanu Boral's user avatar
4 votes

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

You can use the CASESAFEID formula in the Flow to get the correct ID: {!CASESAFEID($User.Id)} At this point, you'll be able to safely compare the OwnerId to the logged-in user's ID.
sfdcfox's user avatar
  • 487k
4 votes

Deleting Users from Salesforce permanently

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 ...
Robert Thomas's user avatar
4 votes
Accepted

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

I resolved this issue. From the Email Template Editing page, there is an "Available Merge Fields". From that panel, people can choose whatever merge field for the Email template. Here for my usage, ...
Yifei Pei's user avatar
  • 111
4 votes
Accepted

Can't reference User.LanguageLocaleKey in Formula Field / Workflow / Validation rule

Using Labels You can leverage the fact that labels are automatically translated, even in Formula Fields and workflow rules. Create a Label - "CurrentLanguage" "Translate" that label so that the ...
Rob Baillie's user avatar
3 votes
Accepted

Visualforce page saying Constructor is not visible

There are two points. First you need to make it public. Second you can't make DML in constructor so create a method and put your DML there and call that method from your page's action attribute. ...
Tushar Sharma's user avatar
3 votes
Accepted

create user in trigger of contact

You can try below code. Step 1- A trigger on Contact Object, which will get executed after inserting a Contact Record. Step 2 - Fetch only those contact where ConvertedFromContact__c is true and ...
Devendra's user avatar
  • 5,075
3 votes

Get dateformat based on Locale

If you can use the Salesforce outputField component, it will automatically adjust to the locale of the context user. If you have a custom controller or extension on your page, the instance method ...
sfdc's user avatar
  • 13.6k
3 votes

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

When creating a permission set, you can opt to have it auto-assigned whenever another specific permission set is assigned. For instance, let's say you a Permission Set for a managed package, which you ...
Jennifer Harris's user avatar
3 votes

Whait is the use of the managerId on user

ManagerId does not control the visibility but has an important role in the approval process inside sfdc .Because of this field you can dynamically assign records to corresponding managers . Also if ...
Mohith Shrivastava's user avatar
3 votes
Accepted

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

Yes, Salesforce maintains a hidden user called "Automated Process user". The user exists at the time that an organization is created and may be used by Salesforce to make automated system-level ...
Ayub's user avatar
  • 3,483
3 votes

Can community user query internal users of salesforce

Check the OWD for user object in sharing setting. It will be public read/only for Internal and private for external. That means, Internal users can querry all users whereas community user can only ...
Pranay Jaiswal's user avatar
3 votes
Accepted

Is it possible to create a user from one Org to another automatically?

There is no configuragble solution for this. You will need to utilize APIs (SOAP or REST) here to be able to create User in any Org. If you choose REST, then you will have to consider additional ...
Jayant Das's user avatar
  • 30.5k
3 votes
Accepted

LWC locale does not match Apex version

Why does the LWC version of locale use a dash and not an underscore? Because this conforms to various standards set forth in RFCs, IETF specifications, etc. In reality, the problem here is Apex, ...
sfdcfox's user avatar
  • 487k
3 votes

Flow not triggering from User object

It's not an issue with the Flow, but the fact that updating the user's profile picture doesn't run any triggers for User. The same applies to the banner photo. You can quickly test this with apex ...
Kris Goncalves's user avatar
3 votes
Accepted

How can I create salesforce user (not `Account` record) through salesforce CLI?

It is possible to create user's account through CLI but it seems that there's no option to reset password. So the user will have to reset it manually. To create user's account through CLI, use force:...
user2475983's user avatar
3 votes
Accepted

"Org doesn’t have permission to display chatter photos on component" when installing managed package

You need to disable the Accessibility Mode and then try to install the package. Steps: From your personal settings, enter Accessibility in the Quick Find box, then select Accessibility. No matching ...
Swetha Maddali's user avatar
3 votes

What are possible side effects of having fields on User object which should be frequently updated?

I would strongly consider putting these fields on a separate object. For one thing, any field you update on the User object shows up in the Setup Audit Trail, so making several such updates per user ...
Adrian Larson's user avatar
  • 150k
2 votes
Accepted

Evaluate the current User in a visual workflow

You should be able to use Global Variables for your scenario . Precisely you should be able to use {$!User.Id} to get the Id of the User executing the visual workflow. Note that global variables are ...
Mohith Shrivastava's user avatar
2 votes

Retrieve UserId of @mention user from chatter post in Apex

Here is the update of the code for 2023, getFeedItem is no longer support in latest API version. String communityId = null; String feedItemId = 'YOUR_FEEDITEM_ID'; ConnectApi.FeedElement feedItem = ...
Petr Novotny's user avatar

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