Account Records Using Lightning Component

Create an Account Records Using Lightning Component


A lightning component is an UserInterface framework which is used for the development of dynamic web applications which can be used in mobile Phone and our desktops. For this purpose, JavaScript is used on the client-side and Apex is used on the server-side. The Lightning Component framework is built on the open-source Aura framework. The Aura framework enables us to build apps which are not dependent on our data in Salesforce.

Step 1: Create a Lightning Component

Firstly we have to create a Lightning Component and for thatGo to setup->Developer console, At Developer, console Click on New to create a lightning component and use the code mentioned below:

Step 2: Create a Lightning Controller for the component.

Now, we have created a component, firstly we have to handle the logic at the lightning level then we can move to apex side, for that we have to create a component controller by clicking on the controller in the panel in the right side and use the code mentioned below:

Step 3: Create an Apex class and define the method to create the record.

Now the component which we have created will call lightning controller and then the controller will invoke Method that is written in apex class for that use the code mentioned below:

Step 4: Create a Lightning application which will host the component in the App.Lightning App has to created for the hosting purpose. For that Go to Developer Console->New Lightning Application and use the code mentioned below:

Step 5: Test the Application

We have successfully created the application and it’s time to test it.Save and Click on Update Preview to view your created Application. Your page will look something like this.

Now fill in all the details mentioned and Save it.After saving go to your org to see if the account is created or not.Hope you enjoyed this.Thank You.


Leave a Reply


We're not around right now. But you can send us an email and we'll get back to you, asap.


About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2020 Forcetalks. All Right Reserved.

Log in with your credentials


Forgot your details?