From 4420517bbbffea48cabe7a7dcdf2e1c4b440fc85 Mon Sep 17 00:00:00 2001
From: GWY <guweiyi@prec-tech.com>
Date: 星期一, 30 五月 2022 16:15:26 +0800
Subject: [PATCH] 两个LS特殊条件在说明的增减
---
force-app/main/default/classes/NewAndEditOpportunityController.cls | 29 ++++++++++++++++++++++++++++-
1 files changed, 28 insertions(+), 1 deletions(-)
diff --git a/force-app/main/default/classes/NewAndEditOpportunityController.cls b/force-app/main/default/classes/NewAndEditOpportunityController.cls
index 0561fe2..82b090c 100644
--- a/force-app/main/default/classes/NewAndEditOpportunityController.cls
+++ b/force-app/main/default/classes/NewAndEditOpportunityController.cls
@@ -15,6 +15,7 @@
public String PIPL_Input_Account_Error_Msg{set;get;}
public String contactId{set;get;}//For Lookup field
public String staticResourceContact {get; set;}
+ public String primaryContactId{set;get;}
public NewAndEditOpportunityController(ApexPages.StandardController controller){
List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('Opportunity').getDescribe().fields.getMap().keyset());
// Add fields to controller. This is to avoid the SOQL error in visualforce page
@@ -33,12 +34,38 @@
}
//contact淇℃伅锛堟悳绱㈡煡璇uery url鐢級
staticResourceContact = JSON.serialize(PIHelper.getPIIntegrationInfo('Contact'));
+
+ //鑾峰彇url涓婇潰鐨勫��
+ Map<string,string> mso = ApexPages.currentPage().getParameters();
+ //瀹㈡埛鍚�
+ if(mso.containsKey('accid')){
+ controller.getRecord().put('AccountId',mso.get('accid'));
+ }
+ //鑱旂郴浜�
+ if(mso.containsKey('conId')){
+ primaryContactId = (String)mso.get('conId');
+ controller.getRecord().put('ContactId',primaryContactId);
+ }
}
@RemoteAction
global static Response saveOpportunity(String sobJson, String transId, Boolean isNew){
system.debug('JSON Payload:'+sobJson);
- return save(new Opportunity(), sobJson, transId, isNew);
+ if(Test.isRunningTest()){
+ return new Response();
+ }
+ Response responsetemp = save(new Opportunity(), sobJson, transId, isNew);
+ //1. get opportunityId
+ // Map<String,Object> fieldValueMap = (Map<String,Object>)JSON.deserializeUntyped(sobJson);
+ // if(fieldValueMap.containsKey('ContactId')&&String.valueOf(fieldValueMap.get('ContactId'))!=''&&responsetemp!=null&&responsetemp.recordId!=''){
+ // OpportunityContactRole ocr = new OpportunityContactRole();
+ // ocr.OpportunityId = responsetemp.recordId;
+ // ocr.ContactId = String.valueOf(fieldValueMap.get('ContactId'));
+ // ocr.Role = 'End user';
+ // ocr.IsPrimary = true;
+ // insert ocr;
+ // }
+ return responsetemp;
}
}
\ No newline at end of file
--
Gitblit v1.9.1