You need to sign in to do that
Don't have an account?
MaheemSam
conditionally update the ownerid in apex
Hi,
I need to update the lead owner id based on a condition else it must just follow the regular lead assingment rule.
Below is the code
Thanks
Sudhir
I need to update the lead owner id based on a condition else it must just follow the regular lead assingment rule.
Below is the code
for(CTAP_Assessment__c ctap : newLst){ if(ctap.Partner_Account__c != null && ctap.End_Customer_Country__c != 'USA'){ LeadOwner = partnerActs[0].ownerid; system.debug('Lead owner is assigned' + LeadOwner ); } Lead l = new lead (Company = ctap.End_Customer_Name__c, FirstName = ctap.Contact_First_Name__c, LastName = ctap.Contact_Last_Name__c, Email = ctap.Contact_Email__c, Phone = ctap.Phone__c, Title = ctap.Title__c, Industry = ctap.Industry__c, LeadSource = ctap.Lead_Source__c, Country = ctap.End_Customer_Country__c, State = ctap.state__c, Postalcode = ctap.postalcode__c, Employee_Size__c = ctap.Employee_Size__c //,Ownerid = LeadOwner // here is the problem it is showing null always Please suggest me how to set ownerid or update owner id conditionally ); }
Thanks
Sudhir
partnerActs[0].ownerid;?