2

The question is simple: Is there any way to figure out from Apex code if custom settings is marked as protected or not? Looking through DescribeSObjectResult cannot find any single method related to that.

Any ideas would be appreciated, thanks in advance.

  • What do you want to accomplish by knowing if a custom setting is managed or not? – Raul Oct 11 '17 at 11:55
  • @RahulSharma We have some rules which dictate if custom setting should be marked as protected (hidden from subscriber) or not. So based on this we would like to create a test method in our dev org to enforce those rules, i.e. basically control if we accidentally don't forget to make something protected, or cut off access to some settings by mistake. – wesaw Oct 11 '17 at 12:02
  • Is your custom setting in a managed package? – Ankita Oct 11 '17 at 12:34
  • @Ankita Yes, but we are talking about package dev org, i.e. it's the org where we basically are developing this package, so we have access to custom settings - just need to detect in apex code which of them are protected. – wesaw Oct 11 '17 at 17:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.