In Salesforce, we often need to receive notifications or event when there is certain DML/Event happened at some part of the Salesforce by another user or in the backend or through API call from external System. This can be achieved through Platform events. We can subscribe to platform events, When subscribed to platform events we […]
Author: salesforcerlab
What if we wanted to display a LWC page dynamically depending on the user permissions? In LWC we can do that by checking if the user has respective permission and render the page accordingly. For an example, We wanted to display certain data or records, if the user has viewAllData permission, Then we can import […]
In order to bring/refer custom labels inside LWC component, You need to import it through ‘@salesforce/label’ scoped module. Sytax: import lableName from ‘@salesforce/label/NameSpace.labelNameThatWasCreatedInSFDC’; Note: Here the NameSpace will be ‘c’ for the Labels that were created without a namespace in SFDC. If the label was created with in a package, Then we have to given […]
In order to bring/refer a Salesforce content file into LWC, You need to import it through ‘@salesforce/contentAssetUrl’ module. Syntax: import ASSETFILENAME from ‘@salesforce/contentAssetUrl/fileName’; Here ASSETFILENAME holds the data of the file and you can refer that in the HTML or assign it to any var in js and refer that var in HTML.
In order to import the external or third party js or CSS in to LWC, We have to import them into Salesforce as static resource first. Then we need to import that file using loadScript and loadStyle methods and by referring file path inside the static resource. We need to import loadScript and loadStyle methods […]
In LWC you often need to load static resource. In order to load the static resource in LWC you first need to import the static resource into LWC js file.
You can import static resources from the @salesforce/resourceUrl scoped module. Static resources can be archives (such as .zip and .jar files), images, stylesheets, JavaScript, and other files.