Posts

Showing posts from May, 2021
Image
Workspace API: How to get Record Id of Enclosing/Parent Tab Hi Folks,  I am back with another blog wherein I will discuss how to use Workspace API to get the Record Id of the Enclosing tab. (Basically the parent tab for the current subtab). Specifically in Salesforce Service Console apps when we click on any lookup value then that record's detail page opens in Subtab mode. For example when we click on Account Name from the Account Lookup field in the Case Record Page then we see that the Account Record Page is opened as a subtab under the current Case Record Page Situations can come where we want the Record Id for both the Account Id and the Case Id. We can easily get the AccountId via the recordId attribute. < aura:attribute name = "recordId" type = "Id" /> But how to get the CaseId, this value is present in the parent tab. This blog will give you the answer. Salesforce has provided Workspace API using which we can get this information out. We will dis...

Adding NPM module into LWC

Image
Importing NPM module into LWC Hi Folks, I am back with another post. This time I will be discussing the topic of how to add an NPM module into LWC. Although we all know that to make any 3rd party javascript work in Salesforce we need to have it into Static Resource. But I came into a strange situation wherein I had to use an npm module into LWC.  The issue that I was facing was that the NPM module was having several dependant files which were scattered into several folders and it would have taken me ages to read through all the codes, find the dependency and create a single JS file that is uploadable to static resource. After researching a lot got to know about the Browserify tool ( webpack is also there but browserify is easy to use). Using this tool you can just let the package know which JS file is the source file and  Browserify  will do the magic for you and create a single js file. Enough of talking. Now let's get to the technicalities with an example. :) I will d...