Posts

Showing posts from October, 2024

Salesforce Fact #882 | Handling decimal data in LWC returned from apex wrapper

Image
We need to be careful while dealing with large decimal values in LWC returned from apex in wrapper structure. If the value is large, it is converted to String to avoid any loss of precision. Reference:  https://salesforce.stackexchange.com/questions/327214/lwc-autoconverting-decimal-into-string-sf-bug Attached are the screenshots.

Salesforce Fact #881 | Community user check using ContactId on User

Image
We can make use of ContactId field in User object to identify if the current logged in user is a community user or not. The same can be used in LWC. Attached is the screenshot. Note: The ContactId field cannot be updated manually and while trying to do so, the below error is encountered: 'You can't create a contact for this user because the org doesn't have the necessary permissions. Contact Salesforce Customer Support for help.'

Salesforce Fact 880 | Impact on query using user fullname due to user locale change

Locale changes affect the name format of the user. For some of the locales, the Lastname appears followed by Firstname when full name is displayed. So, if we have any logic where we are fetching data based on the Fullname field on User object, we need to be careful.  For example, if the user's full name is 'Tom Stewart' where Firstname is 'Tom' and Lastname is 'Stewart', in case of Hungarian(Hungary) locale this is interpreted as 'Stewart Tom'. So, either we should use any other field like username or we should use any other filter to fetch the required data.