insert lookup field value through apex class in salesforce -- w3web.net

Create a record on custom Object to insert record Id of lookup field value with passing parameters to apex class using custom controller in Lightning Component Salesforce | how to insert lookup field in salesforce using apex

Hey guys, today in this post we are going to learn about how to Create a record on custom Object to insert record Id of lookup field value with passing parameters to apex class using custom controller in Lightning Component Salesforce .

We used the files in this example

feesCmp.cmp Lightning Component It is used for display the Input filed of Student Name, Course, Date Of Deposit, Paid Amount and Save button on the Table.
feesCmpController.js JavaScript Controller File It is used for insert lookup field value, Date Of Deposit, Paid Amount value to server side apex method.
feesCmp.css Component Style CSS It is used for alignment the lookup popup section and spinner loading image on component.
newStudentCtr.apxc Apex Class Controller It is used for submit the lookup field value, Date Of Deposit, Paid Amount value to server through Save button

Custom Object:- Fees__c

Custom Object Fields:-

StudentName__c

CourseName__c

&DateOfDeposit__c

PaidAmount__c

Lookup Object:- NewStudent__c :- Get the Student name from lookup object field Lookup Object:- Course__c :- Get the Course name from lookup object field

Note:-Static resource zip file

You need to create $Resource.SLDS2016 SLDS zip file (static resource zip file)

Final Output

display picklist and radio values in lightning component -- w3web.net

Other related post that would you like to learn in lightning component.

Create Lightning Component

Step 1:- Create Lightning Component : feesCmp.cmp

From Developer Console >> File >> New >> Lightning Component

feesCmp.cmp [Lightning Component File]

Create Component JavaScript Controller

Step 2:- Create Lightning Component : feesCmpController.js

From Developer Console >> File >> New >> Lightning Component >> JavaScript Controller

feesCmpController.js [JavaScript Controller]

Create Component Style CSS

Step 3:- Create Lightning Component : feesCmp.css

From Developer Console >> File >> New >> Lightning Component >> Component Style CSS

feesCmp.css [Component Style CSS]

Create Apex Class Controller

Step 4:- Create Apex Class : newStudentCtr.apxc

From Developer Console >> File >> New >> Apex Class

newStudentCtr.apxc [Apex Class Controller]

insert record id of lookup field with apex controller in salesforce -- w3web.net

Further post that would you like to learn in lightning component.

Hi, This is Vijay behind the admin and founder of w3web.net. I am a senior software developer and working in MNC company from more than 8 years. I am great fan of technology, configuration, customization & development. Apart of this, I love to write about Blogging in spare time, Working on Mobile & Web application development, Salesforce lightning, Salesforce LWC and Salesforce Integration development in full time. [Read full bio] | The Sitemap where you can find all published post on w3web.net

3 thoughts on “Create a record on custom Object to insert record Id of lookup field value with passing parameters to apex class using custom controller in Lightning Component Salesforce | how to insert lookup field in salesforce using apex”

Leave a Comment