Guest User

Untitled

a guest
Jan 16th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. public void convertAttendees(ApexPages.StandardController controller){
  2.  
  3. List<LightiningEd__Webinar_Attendees_Status__c> waa = [SELECT id,Name FROM LightiningEd__Webinar_Attendees_Status__c WHERE LightiningEd__Create_Lead__c=TRUE];
  4. System.debug('waa value:::'+waa);
  5. List<Lead> LeadList = new List<Lead>();
  6. for(LightiningEd__Webinar_Attendees_Status__c wa: waa){
  7. System.debug('Name::'+wa.Name);
  8. Lead le = new Lead ();
  9. le.LastName = wa.Name;
  10. le.Status = wa.Name;
  11. le.Company = wa.Name;
  12. LeadList.add(le);
  13.  
  14. }
  15. if(!LeadList.isEmpty()){
  16. upsert LeadList;
  17.  
  18. <apex:page standardController="Webinar__c"
  19. tabstyle="Adobe_Webinars__tab" sidebar="false" extensions="ConvertWebinarAttendees,WebinarDetailsReport,DisplayContact5">
  20. <apex:form >
  21. <apex:pageBlock title="Adobe Connect Integration with Salesforce">
  22. <apex:pageBlockSection title="{!Webinar__c.Name} Details">
  23. <apex:outputField value="{!Webinar__c.Name}"/>
  24. </apex:pageBlockSection><br/>
  25. <center>
  26. <apex:commandButton id="saveBtn" value="Save" action="{!save}" />
  27. <apex:commandButton id="cancelBtn" value="Cancel" action="{!cancel}" />
  28. </center><br/>
  29. </apex:pageBlock>
  30.  
  31. <apex:pageBlock title="{!Webinar__c.Name} Webinar Attendees ">
  32. <apex:pageBlockTable value="{!wee}" var="w" >
  33.  
  34. <apex:column value="{!w.LightiningEd__Create_Lead__c}"></apex:column>
  35.  
  36. <apex:column value="{!w.name}"/>
  37. <apex:inlineEditSupport event="ondblClick" />
  38.  
  39. <apex:column value="{!w.Mobile_Phone__c}"/>
  40. <apex:inlineEditSupport event="ondblClick" />
  41. </apex:pageBlockTable> <br/>
  42. <center>
  43. <apex:commandButton id="saveBtn" value="Save" action="{!save}" />
  44. <apex:commandButton id="cancelBtn" value="Cancel" action="{!cancel}" />
  45. <apex:commandButton id="leadcreate" value="Create Lead" action="{!convertAttendees}"/>
  46. </center><br/>
  47. </apex:pageBlock>
Add Comment
Please, Sign In to add comment