You need to sign in to do that
Don't have an account?

Show error message
Hi,
I have used a trigger within SFDC to check for duplicates leads. The leads are generated using the web to lead form included in our companies website. I would like to show the Message from the trigger in the website when a duplicate lead is being entered, what should be done.
Thanks
KD
Not much luck of that using the standard Web 2 Lead app. As far as I'm aware, there is no way to pass back data from Salesforce.
But now a days, you have Salesforce Sites. Create a custom VF page and use that to collect the data. The VF page can display the outcome from the tirgger (or it wouldn't even need to be a trigger anymore since the VF page can just run APEX).
You can use adderror() method to add custom message in trigger. For more information you can refer Apex-guide documentation.