You need to sign in to do that
Don't have an account?
imishra
Converting Lead to Account and Contact only
Hi,
I have a multiselect picklist field with values A,B,C,D,E.
I want when i select A or B, it should create only account and contact but when i select C or D or E, it should create Account,Contact and Opportunity.
Please help me, its very urgent.
Thanks.
on the picklist onSelect event u can have actionsupport .In the action support function have filter for the two type of picklist value .if u dont want opportuinty then setDoNotCreateOpportunity(True);
http://salesforce.stackexchange.com/questions/4756/convert-lead-through-apex-but-should-not-create-opportunity
But i am using the standard page layout. How do i call the class?
Hi
Write a after update trigger on the lead .
Hi,
I have written the below code:
trigger test on Lead (after update) {
for(Lead lead:Trigger.new) {
if (Lead.IsConverted==true && (lead.Type_of_Contact__c=='Marketing' || lead.Type_of_Contact__c=='PR')){
Database.LeadConvert lc1 = new database.LeadConvert();
lc1.setLeadId(lead.Id);
lc1.convertedStatus = 'Converted';
lc1.setDoNotCreateOpportunity(true);
Database.LeadConvertResult lcr1 = Database.convertLead(lc1);
System.assert(lcr1.isSuccess());
}else{
Database.LeadConvert lc1 = new database.LeadConvert();
lc1.setLeadId(lead.Id);
lc1.convertedStatus = 'Converted';
lc1.setDoNotCreateOpportunity(false);
Database.LeadConvertResult lcr1 = Database.convertLead(lc1);
System.assert(lcr1.isSuccess());
}
}
}
Still its not working. Where should i call this trigger? Will it work for the standard convert button?
Can u plz tell wat m i missing in this?