Posts

Salesforce Fact #904 | Allow user to login only using SSO

How to ensure that users can login using SSO only? First we need to enable the 'Disable login with Salesforce credentials' checkbox under Single Sign-on settings in setup -> Create a PS with the system permission 'Is Single Sign-On Enabled' checked -> Assign this PS to the intended users. Now, the users can login only using SSO, and not using username/password. Failed login attempts are shown as 'The Single Sign-On Gateway Url is invalid' in login history. Note: We should not assign this PS to admin users as they should always have option to login via username/password option to review any system issue on urgent basis. Reference:  https://help.salesforce.com/s/articleView?id=sf.sso_enforce_sso_login.htm&type=5

Salesforce Fact #903 | Check Lead coversion access in LWC

Image
How to check if the current user has access to convert lead or view and edit converted leads in LWC. User permission checks to the rescue. We can use the two user permissions: ConvertLeads and AllowViewEditConvertedLeads to check the same. Reference:  https://www.sfdcamplified.com/challenge-map-between-salesforce-permissionname-and-label/ Attached is the screenshot.

Salesforce Fact #902 | Setting record owner during lead conversion

If a Lead is owned by a Queue, then during lead conversion we need to set the ownerId to any user who will be the owner of the converted account and contact record. So while converting lead from apex code we need to set the owner id else the below error is encountered: System.DmlException: ConvertLead failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Converted objects can only be owned by users. If the lead is not owned by a user, you must specify a user for the Owner field.: [OwnerId]

Salesforce Fact #901 | Few things to consider while using Data Import Wizard

Here are two things to keep in mind while importing records with Data Import Wizard: 1) The fields available for mapping is based on the layout of the selected record type and the field level security of the user. 2) While importing records we need to select a checkbox named 'Trigger workflow rules and processes for new and updated records' in order to trigger the automations in place for that object. Reference:  https://help.salesforce.com/s/articleView?id=000387837&language=en_US&type=1

Salesforce Fact #900 | Getting error record details when allornone flag is true

Image
We can use Database.SaveResult class to know which records failed during DML operation when the allornone flag is false. Similarly, we can get the details of error records  using DmlException  when allornone flag is true. Reference:  https://salesforce.stackexchange.com/questions/410070/return-database-saveresult-when-allornone-is-set-to-true Attached are the screenshots.

Salesforce Fact #899 | LWC record picker with custom settings and metadata

Image
Lightning record picker works with Custom Settings and Custom metadata as well. Attached are the screenshots.

Salesforce Fact #898 | Restricted from sending email

Have you encountered the error: 'You are restricted from sending email' while sending email from the activity section on record detail page. This is because the 'Enforce Email Privacy Settings' option is enabled under Setup -> Email -> Deliverability. Reference:  https://help.salesforce.com/s/articleView?id=000381335&type=1