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
Shivateja Madipalli 18Shivateja Madipalli 18 

Which Objects are displayed in PermissionSet Object Settings?

I am a noob with Salesforce, please bare with my question.

I am creating an App which enables easy edit/creation of PermissionSets on an ORG.

In this process, I am creating a tree view with Permission Sets -> Objects + Permissions -> Fields + Permissions

Step 1. I have retrieved Permission Sets with SOQL "SELECT Id,Name,Description,NamespacePrefix,UserLicenseId,CreatedDate FROM PermissionSet"
Step 2. I am retrieving Objects with "Schema.getGlobalDescribe()"
Here is my question, I am able to fetch all the objects from my ORG.
But, The Object names does not match with the Object names which we generally see in Permission Set -> Object Settings

For example,
With "Schema.getGlobalDescribe()", I get the Object Names, something like this,

Label: Contract, Name: Contract
Label: Contract History, Name: ContractHistory
Label: Order, Name: Order
Label: Order Share, Name: OrderShare

but, in Permission Set -> Object Settings I see something like this,

Accounts
App Launcher
Assets
Campaign Members
Campaigns
Cases
Chatter Coaching
Coaching
Contacts
Content Contracts

All I need is same set of Object Names as we see in "Permission Set -> Object Settings"
I read that the Object names displayed in Permission Set -> Object Settings are the whole set of Objects from ORG but, I see some of them are missing and some are different with just being singular to plural like,

From my code: "Case"
From Permission Set -> Object Settings: "Cases"

Btw, I am doing all of this in Lightning components

Thanks!
ajay rawat 14ajay rawat 14
Hi Shivateja,

                 You may be using getName() in Schema.getGlobalDescribe object, It will reutrn you object name but in Permission set you are getting plural form of object.
 
Try getLabelPlural() instead of getName() if you want same name as in permission set

Thanks
Ajay Rawat
Shivateja Madipalli 18Shivateja Madipalli 18
Hey Ajay, 

I am not using getName(), I am using getLabel(). 

but, even after using getLabelPlural(), This is what I am getting.

This is the output I see when using,  Schema.getGlobalDescribe with getLabelPlural()
  1. Object Name: Contracts
  2. app.js:44 Object Name: Contract History
  3. app.js:44 Object Name: Contract Feed
  4. app.js:44 Object Name: Orders
  5. app.js:44 Object Name: Order Share
  6. app.js:44 Object Name: Order History
  7. app.js:44 Object Name: Order Feed
  8. app.js:44 Object Name: Order Products
  9. app.js:44 Object Name: Order Product History
  10. app.js:44 Object Name: Order Product Feed
  11. app.js:44 Object Name: Contract Contact Role
  12. app.js:44 Object Name: Opportunity Stage
  13. app.js:44 Object Name: Lead Status Value
  14. app.js:44 Object Name: Case Status Value
  15. app.js:44 Object Name: Solution Status Value
  16. app.js:44 Object Name: Partner Role Value
  17. app.js:44 Object Name: Task Priority Value
  18. app.js:44 Object Name: Task Status Value
  19. app.js:44 Object Name: Contract Status Value
  20. app.js:44 Object Name: Record Types
  21. app.js:44 Object Name: Business Process
  22. app.js:44 Object Name: Organizations
  23. app.js:44 Object Name: Mail Merge Template
  24. app.js:44 Object Name: Custom S-Controls
  25. app.js:44 Object Name: Documents
  26. app.js:44 Object Name: Folders
  27. app.js:44 Object Name: Email Status
  28. app.js:44 Object Name: Custom Buttons or Links
  29. app.js:44 Object Name: Email Templates
  30. app.js:44 Object Name: Document Entity Map
  31. app.js:44 Object Name: Letterheads
  32. app.js:44 Object Name: Names
  33. app.js:44 Object Name: Recently Viewed
  34. app.js:44 Object Name: Login History
  35. app.js:44 Object Name: Login IP
  36. app.js:44 Object Name: Client Browser
  37. app.js:44 Object Name: Votes
  38. app.js:44 Object Name: Zones
  39. app.js:44 Object Name: Aggregate Result
  40. app.js:44 Object Name: Campaigns
  41. app.js:44 Object Name: Campaign Share
  42. app.js:44 Object Name: Campaign Feed
  43. app.js:44 Object Name: Campaign Member Status
  44. app.js:44 Object Name: Campaign Members
  45. app.js:44 Object Name: Accounts
  46. app.js:44 Object Name: Account Share
  47. app.js:44 Object Name: Account History
  48. app.js:44 Object Name: Account Feed
  49. app.js:44 Object Name: Contacts
  50. app.js:44 Object Name: Contact Share
  51. app.js:44 Object Name: Contact History
  52. app.js:44 Object Name: Contact Feed
  53. app.js:44 Object Name: Leads
  54. app.js:44 Object Name: Lead Share
  55. app.js:44 Object Name: Lead History
  56. app.js:44 Object Name: Lead Feed
  57. app.js:44 Object Name: Opportunities
  58. app.js:44 Object Name: Opportunity Share
  59. app.js:44 Object Name: Opportunity Field History
  60. app.js:44 Object Name: Opportunity Feed
  61. app.js:44 Object Name: Opportunity Contact Role
  62. app.js:44 Object Name: Opportunity History
  63. app.js:44 Object Name: Opportunity Product
  64. app.js:44 Object Name: Opportunity: Competitor
  65. app.js:44 Object Name: Partner
  66. app.js:44 Object Name: Account Partner
  67. app.js:44 Object Name: Opportunity Partner
  68. app.js:44 Object Name: Forecast Share
and many more. where as, in Salesforce Permission Set -> Object Settings
  1. Accounts
  2. App Launcher
  3. Assets
  4. Campaign Members
  5. Campaigns
  6. Cases
  7. Chatter
  8. Coaching
  9. Coaching
  10. Contacts
  11. Content
  12. Contracts
  13. D&B Companies
  14. Dashboards
  15. Data.com
  16. Documents
  17. Duplicate Record Items
  18. Duplicate Record Sets
  19. Events
  20. Expenses
  21. Feedback
  22. Feedback Questions
  23. Feedback Question Sets
  24. Feedback Requests
  25. Feedback Templates
  26. Files
  27. Forecasts
  28. Global
  29. Goal Links
  30. Goals
  31. Goals
  32. Groups
  33. Home
  34. Ideas
  35. Leads
  36. Libraries
  37. Macros
  38. Metric Data Links
  39. Metrics
  40. Opportunities
  41. Opportunity Product
  42. Order Products
  43. Orders
  44. Outlook
  45. People
  46. Performance Cycles
  47. Price Book Entries
  48. Price Books
  49. Products
  50. Profile
  51. Profile Coaching
  52. Profile Feed
  53. Profile Feedback
  54. Profile Goals
  55. Profile Overview
  56. Push Topics
  57. Reports
  58. Site.com
  59. Social Personas
  60. Solutions
  61. Streaming Channels
  62. Subscriptions
  63. Tasks
  64. User Provisioning Requests
  65. Users
which are comparatively less and different. like, some of them are different with being plural and some are missing.
Example:
In the list from my code:
  1. Contracts
  2. Contract History
  3. Contract Feed
where as in the list from Permission Set-> Object Settings, I see only
Contracts
 
Shivateja Madipalli 18Shivateja Madipalli 18
Is there a possibility that the user logged in can only access/view only certain objects and not ALL? thus, with UI (Permission Set -> Object Settings) I am able to fetch only certain objects and with code I am able to fetch ALL objects from my ORG?