function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
trigger duplicatePreventer on Account (before insert) { List<Account> acct= [select id, name from Account]; for(Account a:acct) { for(Account a1:Trigger.New) { if(a.Name==a1.Name) { //a1.name.adderror('Account already exist'); a1.adderror('Account already exist'); } } } }
May this link helps you out
http://developer.force.com/cookbook/recipe/preventing-duplicate-records-from-saving
Thanks
Mark it as correct answer if it helps you!
All Answers
May this link helps you out
http://developer.force.com/cookbook/recipe/preventing-duplicate-records-from-saving
Thanks
Mark it as correct answer if it helps you!
Lakshmi Narasimha,
You can write trigger using before insert event.
Please see below trigger which throws an error when account already exists.
Hope this helps you!
Please accept my solution as Best Answer if my reply was helpful. It will make it available for other as the proper solution. If you felt I went above and beyond, you can give me kudos.
Thanks and Regards
Sandhya