Posts

2019 Top Salesforce Interview Questions

If you're preparing for a Salesforce interview, it's crucial to familiarize yourself with commonly asked questions. Below are some of the top questions you might encounter, along with concise answers to help you prepare. Q1: Can we call a future method from a future method? A: No, you cannot call a future method from another future method. However, you can call a Queueable from a future method. If there is no dependency between two future methods, they can be executed sequentially from the original class. Q2: What is the view state in Salesforce? A: The view state in Salesforce refers to an encrypted, hidden form field in Visualforce pages that maintains the state of the page, including component values, field values, and controller state. Q3: What is meant by callout in Salesforce? A: An Apex callout allows Apex code to integrate tightly with external services by making HTTP requests or calling Web services. Salesforce supports both SOAP and RESTful services. Q4: What is th...

Troubleshooting Error: Component Class Instance Initialization Error in Salesforce Lightning

Image
If you're working with Salesforce Lightning and encounter the error message: Error: Component class instance initialization error [Cannot read property 'g' of undefined] you're not alone. This error often arises from a mistake in the doInit event handler configuration in your component. Let's delve into the issue and how to resolve it. Understanding the Error The error is triggered when the doInit action is called improperly. In this case, it happened because of a custom event name defined in the <aura:handler> tag. Let’s take a look at the problematic code: Original Code < aura:component controller = "skb_bugSolving1" > < aura:attribute name = "myAccount" type = "Account[]" /> < aura:handler name = "getAccount" value = "{!this}" action = "{!c.doInit}" /> < div class = "demo-only" style = "width: 320px;" > </ d...

Troubleshooting Error: Unknown Controller Action 'doInit' in Salesforce Lightning

Image
If you’ve encountered the error message: Error : Unknown controller action 'doInit' you’re not alone. This error commonly occurs when using the doInit event in Salesforce Lightning components. Let’s explore why this happens and how to fix it. Understanding the Error The doInit event is automatically fired when a Lightning application or component is initialized, prior to rendering. This means that when the page loads, the doInit event is triggered and the system looks for the corresponding JavaScript function in the component's controller. If the JavaScript controller does not contain a valid doInit function, you will encounter the "Unknown controller action 'doInit'" error. This highlights the importance of ensuring that your controller is properly set up to handle this event. Key Takeaway Whenever you use the doInit event in your Lightning component, it’s crucial to define a valid doInit function in your JavaScript controller. Failing to do so w...