You need to sign in to do that
Don't have an account?
Ralf Wittenberger
2 credentials on Trigger to lookup List
Hi, I have used a Trigger from here to add it to my needs, unfortunately, it seems, I can´t use 2 credentials for the Listlookup, or am i just missing something here?
Trigger ContactOnCases on Case (before insert, before update) {
List<String> Contact = new List<String>();
for (Case a:Trigger.new)
{
Contact.add(a.SuppliedEmail && a.Customer_Number_C__c);
}
List <Contact> ContactList = [Select ID from Contact where Email && Customer_Number__c in :Contact ];
for (Integer i = 0; i < Trigger.new.size(); i++)
if (Trigger.new[i].SuppliedEmail != null) {
Trigger.new[i].ContactID = ContactList[i].ID;
}
else
{
Trigger.new[i].ContactID = null;
}
}
Trigger ContactOnCases on Case (before insert, before update) {
List<String> Contact = new List<String>();
for (Case a:Trigger.new)
{
Contact.add(a.SuppliedEmail && a.Customer_Number_C__c);
}
List <Contact> ContactList = [Select ID from Contact where Email && Customer_Number__c in :Contact ];
for (Integer i = 0; i < Trigger.new.size(); i++)
if (Trigger.new[i].SuppliedEmail != null) {
Trigger.new[i].ContactID = ContactList[i].ID;
}
else
{
Trigger.new[i].ContactID = null;
}
}
Please try with below code I am sure about your requirment I have just given one solution for your issue .
I may resolve your issue ,Please check with query whether you want the AND /OR condtion between your condtion .
All Answers
Please try with below code I am sure about your requirment I have just given one solution for your issue .
I may resolve your issue ,Please check with query whether you want the AND /OR condtion between your condtion .
thanks for your early reply. I have used this with a little changing, but it works. Thanks a lot!