Insert New Record in Custom Object in lwc -- w3web.net

Insert New Record in Custom Object and Navigate to the Record Detail Page Using Apex class method in Lightning Web Component — LWC | Insert record and navigate to record detail page in lwc

Hey guys, today in this post we are going to learn about How to Insert New Record in Custom Object and Navigate to the Record on Detail Page Using Apex class method in Lightning Web Component — LWC.

Files we used in this post example:-

insertRecordCustomObjectLwc.html Lightning Web Component HTML Template HTML file for used to write HTML element for user interface..
insertRecordCustomObjectLwc.js Lightning Web Component JavaScript It is holding submitAction function that is geting the value from input field and save into the database.
insertRecordCustomObjectLwc.js-meta.xml XML Meta File It is used for where this lightning web component you want to exposed
lwcAppExampleApex.cls Apex Controller It is used for call apex method imperatively in LWC Javascript file.

Live Demo

create record for custom object using lwc -- w3web.net

Other related post that would you like to learn in LWC

Step 1:- Create Lightning Web Component : insertRecordCustomObjectLwc.html

SFDX:Lightning Web Component >> New >> insertRecordCustomObjectLwc.html

insertRecordCustomObjectLwc.html [Lightning Web Component HTML]

Step 2:- Create Lightning Web Component : insertRecordCustomObjectLwc.js

SFDX:Lightning Web Component >> New >> insertRecordCustomObjectLwc.js

insertRecordCustomObjectLwc.js [LWC JavaScript File]

Step 3:- Create Lightning Web Component : insertRecordCustomObjectLwc.js-meta.xml

SFDX:Lightning Web Component >> New >> insertRecordCustomObjectLwc.js-meta.xml

insertRecordCustomObjectLwc.js-meta.xml [LWC Meta Data XML]

Step 4:- Create Apex Controller : lwcAppExampleApex.cls

SFDX:Create Apex Class >> New >> lwcAppExampleApex.cls

lwcAppExampleApex.cls [Apex Class]

Insert New Record in Custom Object in lwc -- w3web.net

Further post that would you like to learn in LWC

Related Topics | You May Also Like

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

9 thoughts on “Insert New Record in Custom Object and Navigate to the Record Detail Page Using Apex class method in Lightning Web Component — LWC | Insert record and navigate to record detail page in lwc”

  1. Hi. your post is so nice and I really loved reading your post.
    It was very well authored and easy to understand. Great Thanks for sharing awesome info. I really love to read your blog.

    Reply
  2. for testing – i created the object, fields, and the code of course.
    The Show Toast is working and the record is also getting created but the navigation is not working

    Reply

Leave a Comment