You need to sign in to do that
Don't have an account?
Sameer Vits
How can I pass these values into this trigger code for c.session__c ?
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 ?
Is there any custom field on lead object which is storing the picklist values?