+ Start a Discussion
sessusessu 

to delete custom lead after conversion

Hi I have written a convert button in ajax i need to delete a custom lead(Enquiry) after being converted to student object please help me to write a code for this in ajax var lid5; var result1 = sforce.connection.query("SELECT Id from Enquiry__C WHERE Last_Name__c='" +cname+"'"); var recordss =result1.getArray("records"); var enquiry = []; var enq= new sforce.SObject("Enquiry__c"); var result = sforce.connection.delete(enquiry); lid5=recordss[0].Id.substring( 0,15);