You need to sign in to do that
Don't have an account?
satyam
How to write a trigger to check the duplicate record based on field
Hi,
I have a requirement is that
I have a field name as 'Job Name' where i filles engineer in one record now if user again creating the record where job name is engineer then its should show error massage that one record with same job name is allready exist.
So any idea how i can write a trigger for this.
Thanks in Advance:))))
Check out this recipe: http://developer.force.com/cookbook/recipe/preventing-duplicate-records-from-saving
write a trigger on before update and query the object with the condition.
this is hoe to send a message to a vf page.
ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR, ' Your Message');
ApexPages.addMessage(myMsg);