In a custom (Visualforce) setup page, I would like to provide links that open the "Manage" view for some of our custom settings.
URLFOR (or some other mechanism) provide such a URL? This also needs to work in Lightning Experience.
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
If you simply navigate to
Custom Settings, and then copy the Manage link, it will look like below:
So it should be fairly easy to generate programatically in Apex.
String relativePath = '/setup/ui/listCustomSettingsData.apexp'; String queryString = '?id=' + SObjectType.My_Setting__c.getKeyPrefix(); String manageUrl = URL.getOrgDomainUrl() + relativePath + queryString;
If you are creating this link in
Visualforce and don't want to use Apex, I think it should still work using the
$ObjectType global variable.
Managing Custom Settings in Lightning are always a challenge in my view. I would suggest taking a look at what Salesforce.org does here in the NPSP Package:
Basically, they created a wrapper VF page that then lets you navigate to each setting that lives in its own included VF page, and you can then edit/update with a simple shared controller. Yes, it is more overhead, but I just implemented it for someone else who had a bunch of settings for their managed package, and it provides a simple interface to update all custom settings.