| | |
| | | if(!Test.isRunningTest()){ |
| | | controller.addFields(fieldList); |
| | | } |
| | | SObject obj = controller.getRecord(); |
| | | SObject obj = controller.getRecord(); |
| | | if(obj.Id != null){ |
| | | //更新 |
| | | isNewMode = false; |
| | | Rental_Apply__c rentalApplyData = [select Id,RecordTypeId,AWS_Data_Id__c,Loaner_medical_Staff__c,Loaner_medical_Staff__r.AWS_Data_Id__c from Rental_Apply__c where id =: obj.Id]; |
| | | rtTypeId = rentalApplyData.RecordTypeId; |
| | | //Update record type for Rental Apply by Li Jun 20220419 start |
| | | if(ApexPages.currentPage().getParameters().containskey('RecordType')){ |
| | | rtTypeId = ApexPages.currentPage().getParameters().get('RecordType'); |
| | | } |
| | | controller.getRecord().put('RecordTypeId',rtTypeId); |
| | | //Update record type for Rental Apply by Li Jun 20220419 end |
| | | AWSDataId = rentalApplyData.AWS_Data_Id__c; |
| | | Map<String,String> sfIdToAWSIdMap = new Map<String,String>(); |
| | | if(rentalApplyData.Loaner_medical_Staff__r.Id != null){ |
| | |
| | | if(mso.containsKey('00N10000003OJzc')){ |
| | | controller.getRecord().put('Loaner_received_staff__c',mso.get('00N10000003OJzc')); |
| | | } |
| | | |
| | | |
| | | |
| | | rtTypeId = ApexPages.currentPage().getParameters().get('RecordType'); |
| | | obj.put('OwnerId',UserInfo.getUserId()); |
| | | } |
| | | |
| | | if(mso.containsKey('00N10000003Mp2H')){ |
| | | system.debug('00N10000003Mp2H='+mso.get('00N10000003Mp2H')); |
| | | controller.getRecord().put('Status__c',mso.get('00N10000003Mp2H')); |
| | | } |
| | | |
| | | if(mso.containsKey('00N10000007oQKh')){ |
| | | system.debug('00N10000007oQKh='+mso.get('00N10000007oQKh')); |
| | | controller.getRecord().put('Split_Apply_Reason__c',mso.get('00N10000007oQKh')); |
| | | } |
| | | system.debug('Rental Apply Record Type:'+rtTypeId); |
| | | LayoutDescriberHelper.LayoutWrapper LayoutWrapperValue = LayoutDescriberHelper.describeSectionWithFieldsWrapper(rtTypeId, 'Rental_Apply__c','classic'); |
| | | layoutSections = LayoutWrapperValue.layoutSections; |
| | | layoutSectionsStr = JSON.serialize(layoutSections); //for dynamic add readonly attribute |