Guest User

Untitled

a guest
Feb 14th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. ProcessStagingOpportunity.handleafterInsert(trigger.new);
  2.  
  3. }
  4. for(Account ac : acclist) {
  5. accountMap.put(ac.Name,ac.id );
  6.  
  7. }
  8.  
  9. for(staging__c st :listStage) {
  10. Id accs;
  11. if(st.Individual_or_Organization_c__c =='I'){
  12.  
  13. if(!contactMap.containsKey(st.First_Name_c__c+ '_' +st.Last_Name_c__c +'_' +st.Postal_Code_c__c)) {
  14.  
  15.  
  16. Contact cc =new Contact();
  17. cc.firstname=st.First_Name_c__c;
  18. cc.lastname=st.Last_Name_c__c ;
  19. cc.OtherPostalCode =st.Postal_Code_c__c;
  20. insertContact.add(cc);
  21. system.debug(insertContact +'listtttt');
  22. Opportunity op= new Opportunity();
  23. op.name= cc.firstname;
  24. op.ContactId=cc.id;
  25. if(st.Organization_Name_c__c !='' && st.Postal_Code_c__c !='') {
  26.  
  27. if(accountMap.containsKey(st.Organization_Name_c__c)) {
  28. system.debug('hellohey');
  29. //accs = new account();
  30. system.debug('aaa' +accountMap.get(st.Organization_Name_c__c));
  31. accs = accountMap.get(st.Organization_Name_c__c);
  32. system.debug('######'+''+accs);
  33.  
  34. cc.accountId = accs;
  35.  
  36.  
  37. }
  38. }
  39. }
  40. }
  41. }
  42. insert insertContact;
  43. }
Add Comment
Please, Sign In to add comment