From 8badb57ea2c82557850ad5b39281c3e8714eb119 Mon Sep 17 00:00:00 2001
From: liuyan <liuyan@prec-tech.com>
Date: 星期四, 24 十一月 2022 10:08:31 +0800
Subject: [PATCH] 科室信息漏传SPO问题
---
force-app/main/default/classes/OnCallController.cls | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/force-app/main/default/classes/OnCallController.cls b/force-app/main/default/classes/OnCallController.cls
index 910fdad..3740276 100644
--- a/force-app/main/default/classes/OnCallController.cls
+++ b/force-app/main/default/classes/OnCallController.cls
@@ -18,6 +18,7 @@
public String PIPL_Input_Account_Error_Msg{set;get;}
public String sobjectPrefix{set;get;}
public String sobjecttypeForFrontEnd{set;get;}
+ public String sfRecordIdForEdit{set;get;}//Add By LiJun for edit record from daily report, 20220510
// public String sobjectId{set;get;}
public OnCallController(ApexPages.StandardController controller) {
// sobjectId = [SELECT CustomObjectId,CustomObjectName FROM CustomObjectUserLicenseMetrics where CustomObjectName ='OnCall' limit 1].CustomObjectId;
@@ -45,6 +46,7 @@
isNewMode = false;
On_Call__c onCallData = [select Id,AWS_Data_Id__c from On_Call__c where id =: obj.Id];
AWSDataId = onCallData.AWS_Data_Id__c;
+ sfRecordIdForEdit = obj.Id;//Add By LiJun for Edit Record from NFM609, 20220510
}else{
//鏂板缓
rtTypeId = null;
@@ -113,17 +115,20 @@
String rid = '';
Boolean isClone = false;
String awsDataId = '';
+ String sfRecordId = '';
try{
System.debug('abcde'+isNew);
awsDataId = (String)onCallInfo.get('AWS_Data_Id__c');
+ sfRecordId = (String)onCallInfo.get('Id');
if (string.isBlank(awsDataId)) {
throw new DMLException('鏇存柊鏃禔WS_Data_Id__c涓嶈兘涓虹┖');
}
System.debug('awsDataId = ' + awsDataId);
- On_Call__c[] onCalls = Database.query('select id from On_Call__c where AWS_Data_Id__c =:awsDataId');
+ On_Call__c[] onCalls = Database.query('select id from On_Call__c where AWS_Data_Id__c =:awsDataId or id =:sfRecordId');
if(!isNew){
isClone = onCalls.size() == 0;
}
+ system.debug('isClone'+isClone + ' isNew'+isNew);
if(isNew || isClone){
System.debug('onCallInfozhj = ' + onCallInfo);
insert onCallInfo;
--
Gitblit v1.9.1