From d8dc84a3d56df839895f1c417a4d9cbee763d262 Mon Sep 17 00:00:00 2001
From: 高章伟 <gaozhangwei@prec-tech.com>
Date: 星期五, 03 三月 2023 14:50:59 +0800
Subject: [PATCH] gzw 测试环境代码更新
---
force-app/main/default/classes/MetaDataUtility.cls | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/force-app/main/default/classes/MetaDataUtility.cls b/force-app/main/default/classes/MetaDataUtility.cls
index e7d6eb2..34a5b4e 100644
--- a/force-app/main/default/classes/MetaDataUtility.cls
+++ b/force-app/main/default/classes/MetaDataUtility.cls
@@ -3,8 +3,10 @@
public static List<Metadata.LayoutSection> GetRecordTypePageLayout(string record_type_id,string objectType){
Map<string,object> mso = null;
+ System.debug('rerord 6' + record_type_id + ':' + objectType);
string layout_name = GetRecordTypePageLayoutName(record_type_id,objectType,UserInfo.getProfileId());
-
+ System.debug('layout 8' + layout_name);
+
List<Metadata.LayoutSection> temp = GetLayoutSections(objectType,layout_name);
List<Metadata.LayoutSection> layoutSectionList = new List<Metadata.LayoutSection>();
for(Metadata.LayoutSection section : temp){
@@ -55,7 +57,8 @@
}
}
}
-
+ System.debug('mso 60' + mso);
+
return table_or_enum_id;
}
@@ -87,7 +90,9 @@
public static string GetRecordTypePageLayoutName(string record_type_id,string objectType, string profile_id){
-
+ System.debug('objectType 92' + objectType);
+ System.debug('profile 93 ' + profile_id);
+
if(!string.isBlank(objectType)){
List<sobject> lso = [SELECT Id, Name, DeveloperName, SobjectType, IsActive, Description, BusinessProcessId FROM RecordType where SobjectType = :objectType];
if(lso.size()==0){
@@ -116,6 +121,7 @@
return null;
}else{
Map<string,object> mso = (Map<string,object>)JSON.deserializeUntyped(s);
+ System.debug('mso 122' + mso);
if(integer.valueOf(mso.get('size')) > 0){
List<object> records = ((List<object>)mso.get('records'));
@@ -163,7 +169,9 @@
List<String> componentNameList = new List<String>{object_name+'-'+layout_name};
//閫氳繃Metadata.Operations.retrieve鑾峰彇metadata
//Metadata.Layout -> Metadata.LayoutSection -> Metadata.LayoutColumn objects -> Metadata.LayoutItem objects
+ System.debug('componentNameList 171: ' + componentNameList);
List<Metadata.Metadata> componentList = Metadata.Operations.retrieve(Metadata.MetadataType.Layout, componentNameList);
+ System.debug('componentList 173 ' + componentList);
if(componentList?.size() > 0){
Metadata.Layout layout = (Metadata.Layout) componentList.get(0);
List<Metadata.LayoutSection> layoutSectionList = layout.layoutSections;
--
Gitblit v1.9.1