You need to sign in to do that
Don't have an account?
Anil Kumar 1257
How to write test case
I am write this trigger. i need test class, how to write.
trigger ContactDuplicatemobile on Contact (before insert, before update) {
List<Contact> Contactlist = [select id,MobilePhone from Contact];
for(Contact c:Trigger.new)
{
for(Contact cc: Contactlist)
{
if(c.MobilePhone==cc.MobilePhone)
{
c.adderror('mobile number already exist');
}
} }
}
trigger ContactDuplicatemobile on Contact (before insert, before update) {
List<Contact> Contactlist = [select id,MobilePhone from Contact];
for(Contact c:Trigger.new)
{
for(Contact cc: Contactlist)
{
if(c.MobilePhone==cc.MobilePhone)
{
c.adderror('mobile number already exist');
}
} }
}
It looks like our team of experts can help you resolve this ticket.
We have Salesforce global help-desk support and you can log a case and our Customer Success Agents will help you solve this issue. You can also speak to them on live chat. Click on the below link to contact our help-desk. Trust me it is a support service that we are offering for free!
https://jbshelpdesk.secure.force.com
Thanks,
Jarvis SFDC team