function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jaishrijaishri 

I want to retrieve data from custom setting list using trigger can anyone help me

Sai PraveenSai Praveen (Salesforce Developers) 
Hi Jay,

Can you check the below article which shows about Custom Setting and how to get the values in the Apex .

https://www.apexhours.com/salesforce-custom-settings/

Let me know if you need any further details.

If this solution helps, Please mark it as best answer.

Thanks,
 
CharuDuttCharuDutt
Hii JAYs
Try Below Code EXAMPLE:
Map<String_data_set_name, CustomSettingApiName> var =
CustomSettingApiName.getAll();
Eg: Map<String, Student__c> students = Student__c.getAll();
Please Mark It As Best Asnwer If It Helps
Thank You!
mukesh guptamukesh gupta
Hi Jay,

Please follow below trigger example:- 
 
trigger AddCSR on Opportunity (before insert) {
  // Grab your Custom Setting values
  CSR_Settings__c settings = CSR_Settings__c.getInstance('csr');
  String  CSR_USER_ID      = settings.CSR_User_ID__c;
  Decimal OPP_MIN_VALUE    = settings.Opp_Minimum_Value__c;

  // Create a master list of accounts to bulk update
  List<Account> accounts = new List<Account>();
  
  for (Opportunity opp : Trigger.new) {
    // Make sure we meet the minimum threshold
    if (opp.Amount >= OPP_MIN_VALUE) {
      // This is a trick to get the related account!
      Account acc = new Account();
      acc.Id      = opp.AccountId;
      
      // Update the CSR and add to master list
      acc.CSR__c  = CSR_USER_ID;
      accounts.add(acc);
    }
  }
  // Update the master list of accounts
  update accounts;
}

if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh 
Jos StoneJos Stone
If you want to use a different custom value but the exact name isn't included in the data from a previous step, then you can use a lookup table. (https://aboutwaffles.com/best-non-toxic-waffle-makers/)