From f127c76b19f5316032d4bed127a1dde710c48d74 Mon Sep 17 00:00:00 2001
From: Li Jun <buli@deloitte.com.cn>
Date: 星期四, 24 三月 2022 10:10:36 +0800
Subject: [PATCH] PIPLFunctionFixBug0324

---
 force-app/main/default/classes/NewAndEditContactController.cls |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/force-app/main/default/classes/NewAndEditContactController.cls b/force-app/main/default/classes/NewAndEditContactController.cls
index faf5b4c..b87b107 100644
--- a/force-app/main/default/classes/NewAndEditContactController.cls
+++ b/force-app/main/default/classes/NewAndEditContactController.cls
@@ -13,15 +13,28 @@
             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 +64,7 @@
             
             
         }
+        system.debug('null');
         return null;
     }
     

--
Gitblit v1.9.1