Query a Custom Setting to find Current User’s permissions

Answered

I have created a custom setting from which I am able to restrict access to editing a text box on certain Visual Force pagesThis works greatHowever I am running into an issue when I want to query against the custom setting to find out theuser’s permissions via the API.

From my APEX code I am able to do the following to get the Instance value of the custom setting based on the currentuser’s PID

SomeCustomSetting__c.getInstance(pid);

How can I accomplish the same thing using a SOQL query?

Asked on March 14, 2019 in APEX.
Add Comment
1 Answer(s)
Best answer

Add a WHERE clause to filter by the user’s profile id.

 


Select <fields> from CustomSetting__c where SetupOwnerId = <insert profile Id>

 

Answered on March 14, 2019.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.