| | |
| | | |
| | | protected override void beforeInsert() { |
| | | beforeExecute(); |
| | | //客户人员录入后,【电话】【邮箱】自动录入 thh 20220321 start |
| | | getContactInformation(); |
| | | //客户人员录入后,【电话】【邮箱】自动录入 thh 20220321 end |
| | | } |
| | | protected override void beforeUpdate() { |
| | | beforeExecute(); |
| | | //客户人员录入后,【电话】【邮箱】自动录入 thh 20220321 start |
| | | getContactInformation(); |
| | | //客户人员录入后,【电话】【邮箱】自动录入 thh 20220321 end |
| | | } |
| | | |
| | | protected override void afterInsert() { |
| | |
| | | } |
| | | } |
| | | |
| | | //客户人员录入后,【电话】【邮箱】自动录入 thh 20220321 start |
| | | private void getContactInformation(){ |
| | | List<String> ContactIdList = new List<String>(); |
| | | List<Contact> ContactList = new List<Contact>(); |
| | | Map<String, Contact> ContactMap = new Map<String, Contact>(); |
| | | for(Inquiry_form__c nnObj : newList) { |
| | | if(String.isNotBlank(nnObj.Contact_Name__c)){ |
| | | ContactIdList.add(nnObj.Contact_Name__c); |
| | | } |
| | | } |
| | | if(ContactIdList.size() > 0){ |
| | | ContactList = [select id, Phone, Email from Contact where Id IN :ContactIdList]; |
| | | for(Contact contact : ContactList){ |
| | | ContactMap.put(contact.Id, contact); |
| | | } |
| | | } |
| | | for(Inquiry_form__c nnObj : newList) { |
| | | if(String.isNotBlank(nnObj.Contact_Name__c)){ |
| | | if(String.isNotBlank(ContactMap.get(nnObj.Contact_Name__c).Phone)){ |
| | | nnObj.Phone__c = ContactMap.get(nnObj.Contact_Name__c).Phone; |
| | | } |
| | | if(String.isNotBlank(ContactMap.get(nnObj.Contact_Name__c).Email)){ |
| | | nnObj.Email__c = ContactMap.get(nnObj.Contact_Name__c).Email; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //客户人员录入后,【电话】【邮箱】自动录入 thh 20220321 end |
| | | |
| | | // 战略科室的主担当 を取得、Inquiry_form__Shareに設定(Read) |
| | | // private void shareToOSCM() { |
| | | // //存放用于新增的共享数据 |