Activity › Forums › Salesforce® Discussions › How to implement Custom Setting in apex?
Tagged: Salesforce Apex, Salesforce SOQL
-
How to implement Custom Setting in apex?
Posted by Suraj on April 25, 2017 at 1:35 PMHow to implement Custom Setting in apex?
Klod replied 2 years, 7 months ago 3 Members · 2 Replies -
2 Replies
-
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 = :othervalSuppose 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:
- [adinserter block='9']
-
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.