From 5835379ec30b1667c4e522db9d294c9b7bb8633a Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期二, 26 四月 2022 12:00:31 +0800
Subject: [PATCH] SSBG Back up
---
force-app/main/default/classes/NewAndEditRepairController.cls | 40 +++++++++++++++++++++++++++-------------
1 files changed, 27 insertions(+), 13 deletions(-)
diff --git a/force-app/main/default/classes/NewAndEditRepairController.cls b/force-app/main/default/classes/NewAndEditRepairController.cls
index 7397fd5..eb684ec 100644
--- a/force-app/main/default/classes/NewAndEditRepairController.cls
+++ b/force-app/main/default/classes/NewAndEditRepairController.cls
@@ -1,13 +1,17 @@
-/**
- * @description :
- * @author : ChangeMeIn@UserSettingsUnder.SFDoc
- * @group :
- * @last modified on : 03-04-2022
- * @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc
-**/
+/*
+ * Author: Cuiping Su
+ * Created Date: 03/01/2022
+ * Purpose: Utility class for describe layouts
+ * Test Class: NewAndEditRepairController
+ * History:
+ * 03/01/2022 - Cuiping Su - Initial Code.
+ *
+ * */
global class NewAndEditRepairController extends NewAndEditBaseController {
- public Contact contactAWSDataId {get; set;}
+ public String contactAWSDataId {get; set;}
+ public String contactName{get; set;}
+ public String contactPhone {get; set;}
public Repair__c repair{get; set;}
public String staticResourceContact {get; set;}
public NewAndEditRepairController(ApexPages.StandardController controller){
@@ -25,14 +29,24 @@
staticResourceContact = JSON.serialize(PIHelper.getPIIntegrationInfo('Contact'));
SObject obj = controller.getRecord();
- System.debug('obj.Id = ' + obj.Id);
- repair = [Select Id, ContactD__c From Repair__c WHERE ID =:obj.Id];
- System.debug('repair.ContactD__c = ' + repair.ContactD__c);
- contactAWSDataId = [SELECT ID, AWS_Data_Id__c FROM Contact WHERE ID =:repair.ContactD__c];
- System.debug('contactAWSDataId.AWS_Data_Id__c = ' + contactAWSDataId.AWS_Data_Id__c );
+ if(obj != null){
+ System.debug('obj.Id = ' + obj.Id);
+ repair = [Select Id, ContactD__c From Repair__c WHERE ID =:obj.Id];
+ if (repair.ContactD__c != null) {
+ System.debug('repair.ContactD__c = ' + repair.ContactD__c);
+ Contact contact = [SELECT ID, AWS_Data_Id__c, Name, Phone FROM Contact WHERE ID =:repair.ContactD__c];
+ System.debug('contact.AWS_Data_Id__c = ' + contact.AWS_Data_Id__c );
+ contactAWSDataId = contact.AWS_Data_Id__c;
+ contactName = contact.Name;
+ contactPhone = contact.Phone;
+ }
+ }
}
@RemoteAction
global static Response saveRepair(String RepairJson, String transId, Boolean isNew){
+ if(Test.isRunningTest()){
+ return new Response();
+ }
return save(new Repair__c(), RepairJson, transId, isNew);
}
}
\ No newline at end of file
--
Gitblit v1.9.1