-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
6Questions
-
16Replies
check for existing contacts using email address
We have a requirement where we want to check if contact exists using email address custom field. If contact exists then we just want to update incoming information. If contact doesn't exists then it should create a new contact. Also, is apex a better solution or workflows?
-
- Sameer Vits
- June 15, 2018
- Like
- 0
- Continue reading or reply
How to pass picklist value as function parameter in a trigger
Public class AutoConvertLeads { @InvocableMethod public static void LeadAssign(List<Id> LeadIds) { Database.LeadConvert Leadconvert = new Database.LeadConvert(); Leadconvert.setLeadId(LeadIds[0]); lead l= [SELECT Id, email FROM Lead WHERE id=:LeadIds[0]]; LeadStatus Leads= [SELECT Id, MasterLabel FROM LeadStatus WHERE IsConverted=true LIMIT 1]; contact[] clist=[select id,name,session__c from contact where email=:l.email limit 1 ]; if(clist.size()>0){ contact c=clist[0]; c.session__c='PUT_THE_VALUE_YOU_WANT_TO_UPDATE_THE_FIELD_WITH'; //Make sure you are inserting value according to field type. update c; } else{ Leadconvert.setConvertedStatus(Leads.MasterLabel); Leadconvert.setDoNotCreateOpportunity(TRUE); //Remove this line if you want to create an opportunity from Lead Conversion Database.LeadConvertResult Leadconverts = Database.convertLead(Leadconvert); System.assert(Leadconverts.isSuccess()); } } }The session value comes from web to lead form depending on person signing up. It's a picklist. The values are dates as mentioned - May 24; 2 PM - 4 PM, June 28; 9 AM - 12 PM, May 24; 10 AM -12 PM, June 28; 4:30 PM - 7:30 PM, July 26; 9 AM - 12 PM, July 26; 4:30 PM - 7:30 PM.
How can I pass these values into this trigger code for c.session__c ?
-
- Sameer Vits
- May 23, 2018
- Like
- 0
- Continue reading or reply
update specific field under contact if contact already exists
I have a trigger autoconverting leads into Contact when someone submits the web to lead form. I want to update 'session' field under Contact, if Contact (converted lead) already exists. If we can check this using email address. I am new with Apex and need help with writing the code.
-
- Sameer Vits
- May 22, 2018
- Like
- 0
- Continue reading or reply
In Pardot, automation rule doesn't email duplicate emails. It says 'not applied: duplicate email'? Is there a way to change it to where it can still send email to duplicate emails too.
In Pardot, automation rule doesn't email duplicate emails. It says 'not applied: duplicate email'? Is there a way to change it to where it can still send email to duplicate emails too.
-
- Sameer Vits
- May 16, 2018
- Like
- 0
- Continue reading or reply
I have a web to lead form. I want to use datepicker in that form instead of date as text type.
I have a custom date field. I want the date field use a datepicker instead of text and still return value to Salesforce.
-
- Sameer Vits
- May 07, 2018
- Like
- 0
- Continue reading or reply
Copy text from custom text field to custom lookup field.
I have 2 fields, one is custom text field A and second is PAP lookup field. Both fields are under Contacts. Is there a way to copy text from text field 'A' to lookup field 'PAP'? PAP lookup field is looking up to Account Name.
-
- Sameer Vits
- April 16, 2018
- Like
- 0
- Continue reading or reply
check for existing contacts using email address
We have a requirement where we want to check if contact exists using email address custom field. If contact exists then we just want to update incoming information. If contact doesn't exists then it should create a new contact. Also, is apex a better solution or workflows?
- Sameer Vits
- June 15, 2018
- Like
- 0
- Continue reading or reply
How to pass picklist value as function parameter in a trigger
Public class AutoConvertLeads { @InvocableMethod public static void LeadAssign(List<Id> LeadIds) { Database.LeadConvert Leadconvert = new Database.LeadConvert(); Leadconvert.setLeadId(LeadIds[0]); lead l= [SELECT Id, email FROM Lead WHERE id=:LeadIds[0]]; LeadStatus Leads= [SELECT Id, MasterLabel FROM LeadStatus WHERE IsConverted=true LIMIT 1]; contact[] clist=[select id,name,session__c from contact where email=:l.email limit 1 ]; if(clist.size()>0){ contact c=clist[0]; c.session__c='PUT_THE_VALUE_YOU_WANT_TO_UPDATE_THE_FIELD_WITH'; //Make sure you are inserting value according to field type. update c; } else{ Leadconvert.setConvertedStatus(Leads.MasterLabel); Leadconvert.setDoNotCreateOpportunity(TRUE); //Remove this line if you want to create an opportunity from Lead Conversion Database.LeadConvertResult Leadconverts = Database.convertLead(Leadconvert); System.assert(Leadconverts.isSuccess()); } } }The session value comes from web to lead form depending on person signing up. It's a picklist. The values are dates as mentioned - May 24; 2 PM - 4 PM, June 28; 9 AM - 12 PM, May 24; 10 AM -12 PM, June 28; 4:30 PM - 7:30 PM, July 26; 9 AM - 12 PM, July 26; 4:30 PM - 7:30 PM.
How can I pass these values into this trigger code for c.session__c ?
- Sameer Vits
- May 23, 2018
- Like
- 0
- Continue reading or reply
update specific field under contact if contact already exists
I have a trigger autoconverting leads into Contact when someone submits the web to lead form. I want to update 'session' field under Contact, if Contact (converted lead) already exists. If we can check this using email address. I am new with Apex and need help with writing the code.
- Sameer Vits
- May 22, 2018
- Like
- 0
- Continue reading or reply
Copy text from custom text field to custom lookup field.
I have 2 fields, one is custom text field A and second is PAP lookup field. Both fields are under Contacts. Is there a way to copy text from text field 'A' to lookup field 'PAP'? PAP lookup field is looking up to Account Name.
- Sameer Vits
- April 16, 2018
- Like
- 0
- Continue reading or reply