How to Avoid Duplicate Name Record Simply Using a Apex Controller Method -- w3web.net

How to Avoid Duplicate Name Record Simply Using a Apex Controller Method and Validating a Lightning Input Form with Email Regex Pattern Checked and Submit Form on Click Button in Salesforce Lightning | How to prevent duplicate name record simply using a apex controller method

496 views

Hey guys, today in this post we are going to learn about How to Avoid Duplicate Name Record Simply Using a Apex Controller Method and Validating a Lightning Input Form with Email Regex Pattern Checked and Submit on Click Button in Salesforce Lightning.

Files we used in this post example:-

preventDuplicateApp.app Lightning Application It is used for call the component to preview on browser.

preventDuplicateCmp.cmp

Lightning Component It is used for create a Score Card form  on lightning component .

preventDuplicateCmpController.js

JavaScript Controller File It is used for click function for submit the Input field Value into Database.
preventDuplicateCmpHelper.js JavaScript Helper Controller File It is used for fetch the dropdown picklist value from server and it’s call on Javascript doInit function.
preventDuplicateCmp.css Component Style CSS It is used for create custom Style CSS for alignment the form input field and Validation Error.
preventDuplicateController.apxc Apex Controller File It is used for insert input value into database server.

Live Demo

How to Avoid Duplicate Name Record Simply Using a Apex Controller Method -- w3web.net

 

Other related post that would you like to learn in Salesforce

 

Step 1:- Create Lightning Application : preventDuplicateApp.app

From Developer Console >> File >> New >> Lightning Application

preventDuplicateApp.app [Component Application File]

Step 2:- Create Lightning Component : preventDuplicateCmp.cmp

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

preventDuplicateCmp.cmp [Lightning Component File]

Step 3:- Create Lightning Component : preventDuplicateCmpController.js

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

preventDuplicateCmpController.js [JavaScript Controller]

Step 4:- Create Lightning Component : preventDuplicateCmpHelper.js

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

preventDuplicateCmpHelper.js [JavaScript Helper File]

How to Avoid Duplicate Name Record Simply Using a Apex Controller Method -- w3web.net

Step 5:- Create Lightning Component Style: preventDuplicateCmp.css

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

preventDuplicateCmp.css [Style CSS]

Step 5:- Create Apex Class : preventDuplicateController.apxc

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

preventDuplicateController.apxc [Apex Class Controller]

 

 

Further post that would you like to learn in Salesforce

 

 


 

FAQ (Frequently Asked Questions)

How do you prevent duplicate records in Salesforce Apex?

Preventing duplicate records in Salesforce based on a single field can be achieved using a Set that can store the values of that specific field from all existing records and compare it with the list of new records that are going to be inserted.

How do you prevent duplicate records in Salesforce using validation rule?

We'll check this field in our flow. Next, we need to create the validation rule that will prevent a user from creating the duplicate record. This rule only needs to look at our Prevent Save checkbox. Since validation rules fire when the criteria is true, we only have to add the API name of the field.

How do I bypass duplicates in Salesforce?

For a duplicate rule, when the Alert option is enabled, bypass alerts and save duplicate records by setting this property to true . Prevent duplicate records from being saved by setting this property to false.

Related Topics | You May Also Like

  • Your reaction of the article ▾
 

Hi, This is Vijay Kumar 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

7 thoughts on “How to Avoid Duplicate Name Record Simply Using a Apex Controller Method and Validating a Lightning Input Form with Email Regex Pattern Checked and Submit Form on Click Button in Salesforce Lightning | How to prevent duplicate name record simply using a apex controller method”

  1. You’re a beautiful inspiration. It really helps me in any situation. Where I stuck. Many of my friends told me to comment there post but I stuck what I should comment. Finally I got your post it always help me. Thanks for the lovely post.

    Reply

Leave a Comment