function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rajan PatilRajan Patil 

How to get app specfic profile list?

My business user don't know what are all profile or users belogs to his application and for his department having different layouts for Page Layout.

Now they are asking us to add some fields on page layout which having access for them.

My requirment is i want to know the list of page layout belongs the custom app as well the list of profiles assigned to it.

Can anyone have some code snipest or SOQL for the same?
David Zhu 🔥David Zhu 🔥
You may refer to following code snippet. Please note this is just concept of how to get the tabs in each application. You will have to modify code following Salesforce best practice (i.e no soql in  a  loop).

//1. get user applications
List<UserAppMenuItem> userApps = [select appmenuitemid, applicationid, label, name, type from UserAppMenuItem where type='tabset'];
//2.loop through all applications to get appdefinination
for (UserAppMenuItem  app : userApps)
{
   AppDefinition  appdefiniation = [SELECT Description, DeveloperName, DurableId, Label FROM AppDefinition where id=:app.applicationid];
  
   //3. get all tabs in the application
    List<AppTabMember>  tabs = [SELECT AppDefinitionId, SortOrder, TabDefinitionId, TabDefinition.Name, TabDefinition.Label FROM        AppTabMember WHERE AppDefinition.DurableId = :appdefiniation.DurableId];

}


 
VinayVinay (Salesforce Developers) 
Hi Rajan,

You can navigate to the specific app from Quick find--->App and check.

You can find list of profiles assigned.  Also, you can check on individual profiles and see app permissions.

You can check objects assigned under 'Choose Navigation Tab Items' and it has nothing to do with page layout you need to check manually.

User-added image

SELECT Id,DeveloperName FROM AppDefinition
SELECT Name FROM AppMenuItem

References:
https://salesforce.stackexchange.com/questions/289295/soql-query-for-to-get-the-tabs-of-particular-application

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
Vinay Kumar