You need to sign in to do that
Don't have an account?
learn_cloudsf
vf page gives error while saving
Hi all ,
I am trying to implemnt the codde from below link to test the prevention of avoiding duplicates from accounts.
https://developer.salesforce.com/page/Avoid_Creation_of_Duplicate_Account_Names
However while saving the vf page i get an error. what wrong I am doing?
Thanks inadvance
Joe
I am trying to implemnt the codde from below link to test the prevention of avoiding duplicates from accounts.
https://developer.salesforce.com/page/Avoid_Creation_of_Duplicate_Account_Names
However while saving the vf page i get an error. what wrong I am doing?
Thanks inadvance
Joe
The content you are trying from this link (https://developer.salesforce.com/page/Avoid_Creation_of_Duplicate_Account_Names) is Support only on S-Control NOT for Visualforce Page. S-Control is already expired, you cannot use this no more.
So i would like to suggest go for trigger, Find the below link it will helpful to prevent duplicate records.
http://developer.force.com/cookbook/recipe/preventing-duplicate-records-from-saving
All Answers
What error you are getting?
Error: Content is not allowed in prolog.
Error: joepage12 line 1, column 1: Content is not allowed in prolog
Thanks.
Please try following codel:
If its helps, please mark as best answer so it will help to other who will serve same problem.
Thanks!
If you want to avoid duplicates you can write a trigger . the below trigger may help you
trigger dupeacc on Account (before insert)
{
for(account a:trigger.new)
{
list <account > ac=[select id, name from account where name=:a.name];
if(ac.size()>0)
{
a.addError('duplicates are not entertained');
}
}
}
I did paste your code.
it gave Error: vfnew line 159, column 14: Open quote is expected for attribute "name" associated with an element type "form"
Error: Open quote is expected for attribute "name" associated with an element type "form".
The content you are trying from this link (https://developer.salesforce.com/page/Avoid_Creation_of_Duplicate_Account_Names) is Support only on S-Control NOT for Visualforce Page. S-Control is already expired, you cannot use this no more.
So i would like to suggest go for trigger, Find the below link it will helpful to prevent duplicate records.
http://developer.force.com/cookbook/recipe/preventing-duplicate-records-from-saving