/**
* CustomSettingController
* @description controller class for updating custom settings...
*
*/
public without sharing class CustomSettingController{
public CustomSetting__c cs {get;set;}
public CustomSettingController(){
cs = CustomSetting__c.getInstance();
}
public PageReference update(){
try{
update cs;
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.CONFIRM,Label.CS_Update_Success));
}catch(DMLException e){
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR,Label.CS_Update_Error));
System.debug(e);
}
return null;
}
}
If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others and improve the overall quality of Discussion Forums.
VF page
Apex code
If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others and improve the overall quality of Discussion Forums.
Gaurav Kheterpal
Certified Force.com Developer| Salesforce Mobile Evangelist| Developer Forums Moderator| Dreamforce Speaker