From 0c4796706fc9473d069b620321a54b20a119906c Mon Sep 17 00:00:00 2001 From: buli <137736985@qq.com> Date: 星期二, 11 七月 2023 14:16:44 +0800 Subject: [PATCH] Merge branch 'LEXUpgrade2023-Deloitte' --- force-app/main/default/classes/LexNewAndEditBasePIPLController.cls | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/force-app/main/default/classes/LexNewAndEditBasePIPLController.cls b/force-app/main/default/classes/LexNewAndEditBasePIPLController.cls index f287f9c..2f1f6eb 100644 --- a/force-app/main/default/classes/LexNewAndEditBasePIPLController.cls +++ b/force-app/main/default/classes/LexNewAndEditBasePIPLController.cls @@ -16,32 +16,32 @@ if (String.isBlank(recordTypeId)) { data.put('recordTypeId', LayoutDescriberHelper.getDefaultRecordType(sobjectType)); } - + //缂栬緫 - if(!String.isBlank(rid)){ + if (!String.isBlank(rid)) { //鑾峰彇瀵瑰簲瀵硅薄鐨勫瓧娈� List<Sobject> lso = Database.query('select id from RecordType where SobjectType = :sobjectType'); String sql = 'select '; DescribeSObjectResult objectType = rid.getSobjectType().getDescribe(); List<String> objectFields = new List<String>(objectType.fields.getMap().keySet()); - sql += String.join(objectFields, ',') +' from '+sobjectType+' where id =\''+rid+'\' limit 1'; + sql += String.join(objectFields, ',') + ' from ' + sobjectType + ' where id =\'' + rid + '\' limit 1'; System.debug('sql = ' + sql); Sobject leadData = Database.query(sql); - if(leadData == null){ - return new ResponseBodyLWC('Error',500, 'id涓嶅瓨鍦�', ''); + if (leadData == null) { + return new ResponseBodyLWC('Error', 500, 'id涓嶅瓨鍦�', ''); } - if(objectFields.contains('recordtypeid')){ - recordTypeId = (String)leadData.get('RecordTypeId'); + if (objectFields.contains('recordtypeid')) { + recordTypeId = (String) leadData.get('RecordTypeId'); System.debug('recordTypeId: ' + recordTypeId); } List<Metadata.LayoutSection> layout = MetaDataUtility.GetRecordTypePageLayout(recordTypeId, sobjectType); data.put('layout', Json.serialize(reviseMetaLayouts(layout))); data.put('recordTypeId', recordTypeId); System.debug('data.recordTypeId: ' + data.get('recordTypeId')); - data.put('AWSDataId', (String)leadData.get('AWS_Data_Id__c')); + data.put('AWSDataId', (String) leadData.get('AWS_Data_Id__c')); //鑾峰彇鍊� System.debug('leadData = ' + JSON.serialize(leadData)); data.put('data', leadData); - }else { + } else { List<Metadata.LayoutSection> layout = MetaDataUtility.GetRecordTypePageLayout(recordTypeId, sobjectType); data.put('layout', Json.serialize(reviseMetaLayouts(layout))); } @@ -212,4 +212,4 @@ private static Boolean isUpdateable(Schema.DescribeFieldResult dfr) { return (new List<String>{ 'Id', 'Name' }).contains(dfr.getName()) || dfr.isUpdateable(); } -} \ No newline at end of file +} -- Gitblit v1.9.1