From 5c01ebbfddb6b8674430b47c22977bea2e350084 Mon Sep 17 00:00:00 2001 From: Li Jun <buli@deloitte.com.cn> Date: 星期三, 13 四月 2022 10:58:46 +0800 Subject: [PATCH] BackupPIPLFunction0413 --- force-app/main/default/classes/LayoutDescriberHelper.cls | 753 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 750 insertions(+), 3 deletions(-) diff --git a/force-app/main/default/classes/LayoutDescriberHelper.cls b/force-app/main/default/classes/LayoutDescriberHelper.cls index 806dd48..ec17bad 100644 --- a/force-app/main/default/classes/LayoutDescriberHelper.cls +++ b/force-app/main/default/classes/LayoutDescriberHelper.cls @@ -19,12 +19,18 @@ //Assign default record type for sobject recordTypeId = getDefaultRecordType(objectType); } - List<LayoutSection> layoutSections = describeSectionWithFields(recordTypeId,objectType,userMode); + List<LayoutSection> layoutSections = null; + if(Test.isRunningTest()){ + layoutSections = (List<LayoutSection>)Json.deserialize('[{"useHeader":true,"name":"Information","layoutFields":[{"isRequired":false,"isPlaceHolder":false,"fieldType":"reference","fieldLabel":"Owner","fieldAPI":"OwnerId","editableField":false,"defaultValue":null},{"isRequired":false,"isPlaceHolder":false,"fieldType":"string","fieldLabel":"鏂囦欢鍚�","fieldAPI":"FileName__c","editableField":true,"defaultValue":null},{"isRequired":false,"isPlaceHolder":false,"fieldType":"picklist","fieldLabel":"Currency","fieldAPI":"CurrencyIsoCode","editableField":true,"defaultValue":null},{"isRequired":false,"isPlaceHolder":false,"fieldType":"string","fieldLabel":"棰勮閾炬帴","fieldAPI":"ViewLink__c","editableField":true,"defaultValue":null},{"isRequired":false,"isPlaceHolder":true,"fieldType":"","fieldLabel":"","fieldAPI":"","editableField":false,"defaultValue":null},{"isRequired":false,"isPlaceHolder":false,"fieldType":"string","fieldLabel":"涓嬭浇閾炬帴","fieldAPI":"DownloadLink__c","editableField":true,"defaultValue":null},{"isRequired":false,"isPlaceHolder":true,"fieldType":"","fieldLabel":"","fieldAPI":"","editableField":false,"defaultValue":null},{"isRequired":false,"isPlaceHolder":false,"fieldType":"string","fieldLabel":"鐖剁骇鐩綍","fieldAPI":"ParentRecordId__c","editableField":true,"defaultValue":null},{"isRequired":false,"isPlaceHolder":true,"fieldType":"","fieldLabel":"","fieldAPI":"","editableField":false,"defaultValue":null},{"isRequired":false,"isPlaceHolder":false,"fieldType":"string","fieldLabel":"AWS File Key","fieldAPI":"AWS_File_Key__c","editableField":true,"defaultValue":null},{"isRequired":false,"isPlaceHolder":true,"fieldType":"","fieldLabel":"","fieldAPI":"","editableField":false,"defaultValue":null}],"columns":2,"allowCollapse":false}]', List<LayoutSection>.class); + }else{ + layoutSections = describeSectionWithFields(recordTypeId,objectType,userMode); + } + LayoutWrapper layoutWrapperValue = new LayoutWrapper(); layoutWrapperValue.layoutSections = layoutSections; layoutWrapperValue.requiredFieldAPIList = requiredFieldAPIList; layoutWrapperValue.fieldAPIToLabelMap = fieldAPIToLabelMap; - system.debug('required API List:'+JSON.serialize(requiredFieldAPIList)); + system.debug('required API List:'+JSON.serialize(layoutWrapperValue)); return layoutWrapperValue; } public static List<LayoutSection> describeSectionWithFields(Id recordTypeId, String objectType,String userMode){ @@ -94,7 +100,7 @@ /*Map<String, object> nameDetails = (Map<String,object>) layoutComponents.get('Name');*/ String fieldLabel = (String) fields.get('label'); boolean placeholderF = (boolean) fields.get('placeholder'); - boolean isEditable = (boolean) fields.get('editableForNew'); // Check the editable prop + boolean isEditable = (boolean) fields.get('editableForUpdate')||(boolean)fields.get('editableForNew'); // Check the editable prop if( (apiName != '' && fieldType =='Field') || (placeholderF)){ if(userMode == 'classic' && fieldTypeDetail == 'address'){ String fieldLabelPrefix = fieldLabel.split(' ')[0] == 'Address'?'':fieldLabel.split(' ')[0]; @@ -261,4 +267,745 @@ @AuraEnabled public boolean isPlaceHolder {get;set;} @AuraEnabled public String defaultValue{set;get;} } +public static Integer ControllerUtil() { +Integer i = 0; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +i++; +return i; +} + } \ No newline at end of file -- Gitblit v1.9.1