Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ProcessStagingOpportunity.handleafterInsert(trigger.new);
- }
- for(Account ac : acclist) {
- accountMap.put(ac.Name,ac.id );
- }
- for(staging__c st :listStage) {
- Id accs;
- if(st.Individual_or_Organization_c__c =='I'){
- if(!contactMap.containsKey(st.First_Name_c__c+ '_' +st.Last_Name_c__c +'_' +st.Postal_Code_c__c)) {
- Contact cc =new Contact();
- cc.firstname=st.First_Name_c__c;
- cc.lastname=st.Last_Name_c__c ;
- cc.OtherPostalCode =st.Postal_Code_c__c;
- insertContact.add(cc);
- system.debug(insertContact +'listtttt');
- Opportunity op= new Opportunity();
- op.name= cc.firstname;
- op.ContactId=cc.id;
- if(st.Organization_Name_c__c !='' && st.Postal_Code_c__c !='') {
- if(accountMap.containsKey(st.Organization_Name_c__c)) {
- system.debug('hellohey');
- //accs = new account();
- system.debug('aaa' +accountMap.get(st.Organization_Name_c__c));
- accs = accountMap.get(st.Organization_Name_c__c);
- system.debug('######'+''+accs);
- cc.accountId = accs;
- }
- }
- }
- }
- }
- insert insertContact;
- }
Add Comment
Please, Sign In to add comment