You need to sign in to do that
Don't have an account?
S Gogati
How to get the ALL the available tabs across all profiles using APEX code
Hi Friends,
I have return the follwoing method
public with sharing class GETTABDescribe {
public string jsonStr {set;get;}
public GETTABDescribe(){
List<string> SObjectList = new List<string>();
jsonStr='';
List<Schema.DescribeTabSetResult> describeTabSetResults = Schema.describeTabs();
Set<String> tabSet=new Set<String>();
for(Schema.DescribeTabSetResult tsr : describeTabSetResults){
List<Schema.DescribeTabResult> tabs = tsr.getTabs();
tabSet.add('-------'+tsr.getLabel()+'---'+tsr.isSelected()+'----'+tsr.getLogoUrl()+'---------');
for(Schema.DescribeTabResult tab: tabs)
{
{
tabSet.add(tab.getSobjectName().toLowerCase());
}
}
}
List<String> setIdList = new List<String>();
setIdList.addAll(tabSet);
setIdList.sort();
jsonStr = String.join(setIdList, '\n');
}
}
Which is returning, only the selected tabs in the ORG and also its running on USER level.
But My requirement is to get the ALL the available tabs across all profiles or system adminstrator level.
I have return the follwoing method
public with sharing class GETTABDescribe {
public string jsonStr {set;get;}
public GETTABDescribe(){
List<string> SObjectList = new List<string>();
jsonStr='';
List<Schema.DescribeTabSetResult> describeTabSetResults = Schema.describeTabs();
Set<String> tabSet=new Set<String>();
for(Schema.DescribeTabSetResult tsr : describeTabSetResults){
List<Schema.DescribeTabResult> tabs = tsr.getTabs();
tabSet.add('-------'+tsr.getLabel()+'---'+tsr.isSelected()+'----'+tsr.getLogoUrl()+'---------');
for(Schema.DescribeTabResult tab: tabs)
{
{
tabSet.add(tab.getSobjectName().toLowerCase());
}
}
}
List<String> setIdList = new List<String>();
setIdList.addAll(tabSet);
setIdList.sort();
jsonStr = String.join(setIdList, '\n');
}
}
Which is returning, only the selected tabs in the ORG and also its running on USER level.
But My requirement is to get the ALL the available tabs across all profiles or system adminstrator level.
sachin kadian 5
Make it without sharing and it should work.
S Gogati
Thanks sachin, I tried wiith WITHOUT SHARING also but no luck. I think this keyword is applying on only obejcts.
S Gogati
Need help on this