Li Jun
2022-05-10 896e69e68ecc01b0b8a4c03dd010e0a31603be6e
force-app/main/default/classes/NewAndEditReportController.cls
@@ -37,6 +37,7 @@
    public String contactName3{set;get;}
    public String contactName4{set;get;}
    public String contactName5{set;get;}
    public String sfRecordIdForEdit{set;get;}//Add By LiJun for Edit Record from NFM609, 20220510
    public NewAndEditReportController(ApexPages.StandardController controller) {
        ApiPrefix = 'PIBackApi';
        layoutEncryptedAPIList = new List<String>();
@@ -70,6 +71,7 @@
            rtTypeId = ReportData.RecordTypeId;
            AWSDataId = ReportData.AWS_Data_Id__c;
            sfRecordIdForEdit = obj.Id;
            Map<String,String> sfIdToAWSIdMap = new Map<String,String>();
            system.debug('ReportData.Practitioner1__r.Id:' + ReportData.Practitioner1__r.Id);
            system.debug('ReportData.Practitioner1__r.AWS_Data_Id__c:' + ReportData.Practitioner1__r.AWS_Data_Id__c);
@@ -256,12 +258,14 @@
            System.debug('自定义格式转换结束');
            String awsDataId = (String)reportInfo.get('AWS_Data_Id__c');
            String sfRecordId =  (String)reportInfo.get('Id');
            System.debug('awsDataId = ' + awsDataId);
            report__c[] reports = [select id from report__c where AWS_Data_Id__c =:awsDataId];
            report__c[] reports = [select id from report__c where AWS_Data_Id__c =:awsDataId or id =:sfRecordId];
            
            if(!isNew){
                isClone = reports.size() == 0;
            }
            system.debug('isClone'+isClone + ' isNew'+isNew);
            if(isNew){
                System.debug('reportInfo = ' + reportInfo);               
                if(!Test.isRunningTest()){