Activity Forums Salesforce® Discussions How to differentiate LIST apart from HIERARCHY setting in Apex?

  • Piyush

    Member
    April 30, 2016 at 6:07 pm

    How to differentiate LIST apart from HIERARCHY setting in Apex?

  • Surbhi

    Member
    May 26, 2016 at 7:00 am

    Hi Piyush,

    Hierarchical Custom Settings

    1. Use this for your most of your VF/Apex config settings for stand alone apps
    2. Don’t put in settings which are environment dependent (e.g. if you have separate test server URLs that should be used in Sandbox vs. Production)
    3. Definitely, if you are storing User Preferences, Hierarchical is the way to go.

    List Custom Settings

    1. Use this if you creating config for a common piece of code that appears in different areas of Salesforce
    2. Use this when there are environmental differences such as Test server URLs vs. Production server URLs
    3. Also can be used as a simple table for frequently used data

    Thanks

  • Piyush

    Member
    May 26, 2016 at 10:54 am

     

    Thanks  @Surbhi for the response. This is helpful for me.

  • shariq

    Member
    September 21, 2018 at 12:08 am

    Hi,

    Custom settings are similar to custom objects and enable application developers to create custom sets of data, as well as create and associate custom data for an organization, profile, or specific user. All custom settings data is exposed in the application cache, which enables efficient access without the cost of repeated queries to the database. This data can then be used by formula fields, validation rules, Apex, and the SOAP API.

    There are two Types of Custom settings
    List Custom Settings : A type of custom setting that provides a reusable set of static data that can be accessed across your organization. If you use a particular set of data frequently within your application, putting that data in a list custom setting streamlines access to it.

    Hierarchy Custom Settings : Hierarchy settings allow you to personalize your application for different profiles and/or users. A type of custom setting that uses a built-in hierarchical logic that lets you “personalize” settings for specific profiles or users. The hierarchy logic checks the organization, profile, and user settings for the current user and returns the most specific, or “lowest,” value. In the hierarchy, settings for an organization are overridden by profile settings, which, in turn, are overridden by user settings.

    Hope this helps.

  • Parul

    Member
    September 21, 2018 at 4:22 am

    There are two types of custom settings:

    List Custom Settings: A type of custom setting that provides a reusable set of static data that can be accessed across your organization.
    Hierarchy Custom Settings: A type of custom setting that uses a built-in hierarchical logic that lets you personalize settings for specific profiles or users.
    Example
    For example we are going to focus on hierarchy type settings. Once created these settings can be used even in formula fields or normally in APEX code to store information which can be only changed by administrators.

Viewing 1 - 5 of 5 posts

Log In to reply.

Popular Salesforce Blogs