From 38f646071ef8012e4229a6d5519a66c242c45718 Mon Sep 17 00:00:00 2001
From: 李彤 <litong@prec-tech.com>
Date: 星期四, 31 三月 2022 18:15:08 +0800
Subject: [PATCH] WLIG-CCT9UG关于市场多年保计提金调整
---
force-app/main/default/classes/NewAndEditContactController.cls | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/force-app/main/default/classes/NewAndEditContactController.cls b/force-app/main/default/classes/NewAndEditContactController.cls
index faf5b4c..022e74b 100644
--- a/force-app/main/default/classes/NewAndEditContactController.cls
+++ b/force-app/main/default/classes/NewAndEditContactController.cls
@@ -6,22 +6,37 @@
List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('Contact').getDescribe().fields.getMap().keyset());
// Add fields to controller. This is to avoid the SOQL error in visualforce page
- controller.addFields(fieldList);
+ if (!Test.isRunningTest()) {
+ controller.addFields(fieldList);
+ }
Init(controller.getRecord());
String contactId = controller.getRecord().Id;
if(contactId != null){
Contact c = [select UnifiedI_Contact_ID__c from Contact where Id =:contactId ];
system.debug('Contact c = '+c);
unifiedIContactID = c.UnifiedI_Contact_ID__c;
+ }else{
+ Map<string,string> mso = ApexPages.currentPage().getParameters();
+ system.debug('mso='+mso);
+ if(mso.containsKey('con4_lkid')){
+ controller.getRecord().put('AccountId',mso.get('con4_lkid'));
+ }
}
+ system.debug('controller.getRecord()='+controller.getRecord());
}
PageReference RedirectStandardPage(){
Map<string,string> mso = ApexPages.currentPage().getParameters();
system.debug(mso);
+ PageReference pg = null;
mso.remove('sfdc.override');
- PageReference pg = new PageReference('/003/e');
+ system.debug('recordId='+recordId);
+ if(string.isBlank(recordId)){
+ pg = new PageReference('/003/e');
+ }else{
+ pg = new PageReference('/'+recordId+'/e');
+ }
//pg.getParameters().putAll(mso);
pg.getParameters().put('RecordType',mso.get('RecordType'));
pg.getParameters().put('accid',mso.get('accid'));
@@ -51,6 +66,7 @@
}
+ system.debug('null');
return null;
}
--
Gitblit v1.9.1