Lightning Web Component Interview Questions - Part 3
How To Do It In Salesforce
by Nitish Talekar
2M ago
 Below are few questions which are asked me during my latest interviews :   22. I want to pass data from HTML file of Parent to Child in LWC? Ans: WE can use slots to pass data from HTML file of Parent to Child. 23. What are the slots in LWC, explain with code ? Ans: Slots allows component to interact, display and receive dynamic content from parent components. Parent.html <template>   <c-child-slot>     <p> i am unnamed slot</p>     <p slot="first"> i am unnamed slot new !</p>   </c-child-slot ..read more
Visit website
Lightning Web Component Interview Questions - Part 3
How To Do It In Salesforce
by Nitish Talekar
2M ago
Below are few questions which are asked me during my latest interviews :   22. I want to pass data from HTML file of Parent to Child in LWC? Ans: WE can use slots to pass data from HTML file of Parent to Child. 23. What are the slots in LWC, explain with code ? Ans: Slots allows component to interact, display and receive dynamic content from parent components. Parent.html <template>   <c-child-slot>     <p> i am unnamed slot</p>     <p slot="first"> i am unnamed slot new !</p>   </c-child-slot> &l ..read more
Visit website
Get records from different Objects using Wire Method
How To Do It In Salesforce
by Nitish Talekar
4M ago
How to use @Wire to get data for Batch of records ?? In LWC project, we usually have scenario where we have to retrieve different records from different object. For this we use Wire method but are you using 2 wire methods for this ? Then you are doing multiple calls which decreases performance.  LWC have 'getRecords' using this we can use wire adapter to get data for a batch of records at once. As this process in Batch style, this reduces the number of network calls which indirectly increases LWC performance. Syntax: @wire(getRecords, { records: [ { recordIds: string[], fields ..read more
Visit website
Easily Iterate Map in Lightning Web Component
How To Do It In Salesforce
by Nitish Talekar
5M ago
In LWC project, we usually stuck how to iterate Map in Lightning Web Component.  Here is the example you can use to iterate Map. 1. Create Apex class StudentController.cls: public class StudentController { @AuraEnabled(cacheble=true) public static Map<String, String> fetchStudentData(){ Map<String, String> mapStudentData = new Map<String, String>(); mapStudentData.put('Om','BCS'); mapStudentData.put('Sai','BTech'); mapStudentData.put('Ram','BE Computer Science'); mapStudentData.put('Radhe','BE Civil'); return mapStudentData; } } 2. Create LWC LW ..read more
Visit website
Sharing and Visibility Scenario based Interview Questions Part 2
How To Do It In Salesforce
by Nitish Talekar
5M ago
11. User A is on vacation and User B wants temporary access of records owned by User A, how to share those records? Ans: For this we have to use "Login Access" feature to log in as another user. Enable "Manage Login Access Policies" checkbox under User B`s profile. 12. User A is not having CRED permission on Account Object even User A is not having VIEW ALL and MODIFY ALL permission and OWD is private still User A is able to Create record. What could be the possible reason ? Ans: May be there is Apex class (without sharing) which have logic to create Account record. 13. User A have ..read more
Visit website
Sharing and Visibility Scenario based Interview Questions Part 1
How To Do It In Salesforce
by Nitish Talekar
5M ago
1. User A manually share record with User B. User A left organization, can User B still access records shared by User A? Ans: No, Once Owner changes, then Owner based sharing remove by Salesforce. New owner need to re-share record with User B. 2. What is Data Skew and Owner Skew ? How to avoid it. Ans: If parent record have more than 10000 child record then its Data skew.  If user is owner of more than 10000 records then its Owner Skew.   We have to monitor if any parent have more child records and move those to other parent. If we have default owner then use some other logic to mak ..read more
Visit website
Lightning Web Component Interview Questions - Part 2
How To Do It In Salesforce
by Nitish Talekar
5M ago
 11. Can I use multiple decorators for one property? Ans:No, we cant use multiple decorators for same property. 12. Do we have application events in LWC? Ans:We dont have application event as such in LWC like Aura rather we have LMS in LWC to communicate between components which are not part of same hierarchy. 13. How to navigate user from LWC component to record detail page? Ans: We can do it using NavigationMixin service. 14. Get current user ID in LWC without apex? Ans: Yes we can get current user ID without apex by simply importing      &nb ..read more
Visit website
Easily Get Custom Labels in LWC
How To Do It In Salesforce
by Nitish Talekar
5M ago
In this blog we are going to learn how we can access custom labels in LWC To access custom label use below syntax: import varName from '@salesforce/label/c.companyDiscount'; Create Custom Label : customLabels.html <template>     <div class="slds-m-around_small">         Company Discount is => {discountDetails}     </div> </template> customLabels.js import { LightningElement, track } from 'lwc'; import companyDiscount from '@salesforce/label/c.companyDiscount'; export default class CustomLabels extends LightningEleme ..read more
Visit website
Create Custom Lookup in LWC in Simple way
How To Do It In Salesforce
by Nitish Talekar
5M ago
 In this blog we are going to see how to create Custom lookup in LWC. 1. Create CustomLookupControllerLWC apex class and copy paste below code public with sharing class CustomLookupControllerLWC {     @AuraEnabled(cacheable=true)     public static List<SObject> searchRecords(String objName,                 String fieldApiName, String searchVal){         try {             String key = '%' + searchVal + '%';             String query = 'SEL ..read more
Visit website
How to pass parameters in @wire method in LWC
How To Do It In Salesforce
by Nitish Talekar
5M ago
 Syntax : @wire(ApexMethodName, {key: value}) for example: @wire(getAllCases, {strOrigin :'$sampleOrigin'}) here while assigning value to variable, in our example (sampleOrigin) we have to add '$' to bind value before sending to Apex. Create Apex class : CaseController public with sharing class CaseController {     @AuraEnabled(cacheable= true)     public static List<Case> getAllCases(String strOrigin){         try {              List<Case> lstCase = [SELECT Id, Subject, Origin    ..read more
Visit website

Follow How To Do It In Salesforce on FeedSpot

Continue with Google
Continue with Apple
OR