How to update Custom Settings value using Apex in Salesforce?

We can query or we can use getInstance() to get the value and then we can use update keyword to update the Custom Settings value.

Sample Code:

Test__c t = Test__c.getInstance('TT');
t.Size__c = 908;
update t;

Here Test__c is a Custom Settings.


No comments:

Post a Comment

Sharing is Caring!!! Share this with your friends!!!

submit to reddit