Salesforce Lightning Component Framework – All you need to know to get started…

Salesforce Lightning Component framework is really awesome. This is the framework which is having Apex on the server-side and JavaScript on the client-side. In this post, I will go through few objects, functions, concepts which will be used very frequently in most of the framework. So let’s get started -Controller -Below is one controller function. It takes three parameters component, event, helper.  Controller functions are used for client-side activities. For example – behavior on button click, form submit etc. can be defined inside a controller function. When calling this functions, as a developer, you don’t need to set these parameters, the framework will populate them with the required values.Helper Functions – This is the place where you will write all your codes which will be shared between components or sub components. If you have something non-trivial logic, you should move that to helper function and let your controller call the helper function. Below is one example where I am retrieving all cases. Now to retrieve cases, I need to write SOQL and that is something happening inside Apex controller (Server-Side). So my helper function getCases is calling the Apex controller’s function and I am calling my handling function (getCases) from controller function. The advantage with this approach is that now I can call getCases whenever required from my controller. I don’t need to repeat the same login every time.Component – Lightning component is...

Read More