Activity Forums Salesforce® Discussions How to implement Custom Setting in apex?

  • Saurabh

    Member
    April 26, 2017 at 6:18 am

    Hi Suraj

    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, flows, Apex, and the SOAP API.

    You can use SOQL to query Custom Settings just like an object. Use a SQOL query to find the right value:

    select yourfieldname from customsettingname
    where fieldname = :someval and fieldname = :otherval

    Suppose you have custom setting Games__c.

    You can get the list of records through :
    List<Games__c> mcs = Games__c.getall().values();

    To get individual record 'My Games' of custom setting :
    Games__c objGame = Games__c.getValues('My Games');

    Hope it helps:

  • Klod

    Member
    October 2, 2023 at 9:35 am

    Hello! Game development is a rather complex process in which it is important to take into account various stages. It's great that there is now a lot of useful information on the Internet both for those who want to develop a game and for those who are doing it.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos