You need to sign in to do that
Don't have an account?
case trigger help
Hi experts
I just started working in a salesforce company as a developer.
This is my trigger.I have a trigger on case object which was written by my old developer,
http://wiki.developerforce.com/page/Autocreating_Contacts_From_Web_To_Case
This is what he used.
It works fine now.I should include new use case in this trigger where i have to also check with web phone number.
If email match is not found then i should try to find match on contact phone number.If more than one contact has the phone number, pick the one with the most recent created date and associate the Case with that contact.
I dont understand how i can get this.Please help.!!!
Just like a starting point:
All Answers
Just like a starting point:
Thanks but It didnt work..
It is not even creating contact name.It is showing null in salesforce.
It is NOT linking with contact which has same phone number as supplied phone:(
It is working with Email address only:(
Please help ... I need tis ASAP
HI
I am sharing some code ,hope It will help you.
I have created two custom field SuppliedEmail__c and SuppliedPhone__c ,
when you create a case you will give value to suppliedEmail and suppliedEmail, then It will check in Contact whether that email exists or not,If exists then case will be created under that contact record.
If there is no matching records founnd with respect to SuppliedEmail, then It will check w.r.t. SuppliedPhone, If found case will be created in most recent record.
I missed not.
It is : It is not linking with contact which has same phone number as supplied phone:(
Sorry sir
I've created a simple test and it pass successfully:
It's supposed that there is a contact with MobilePhone and new case with non-empty fields SuppliedName, SuppliedEmail and SuppliedPhone will be linked to that contact by the MobilePhone. I think the problem is in the if statement wich I took as is from the link you provided:
You should rewrite this statement for your needs.
@Asish Kumar: Thanks sir..I tired this.It worked well for email but its not working for phone number.
If I remove the class and just have the trigger, it does nothing, if I change the class to reflect something like 'SuppliedEmail=SuppliedEmail' then that does not work and tells me I need to have a ' ' involved in it which would require me to have a predefined email which is not what we are trying to do here. I know this is a 3 year old thread but it doesn't make sense to have the class auto creating cases with predefined inforamtion.
Any help would be greatly appreciated.