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
Serge DevSerge Dev 

Modifying a custom setting's fields via a visualforce page

I need to have a custom setting which should be modifiable via a visualforce page but I'm not sure how to access and as well as modify it via the visualforce page - particularly I'm not sure what the syntax should look like. This custom setting should be static per each salesforce org.

The custom setting I have now looks similar to (it is Public and is a List):
ccc_SettingObject__c

where it's custom fields are (both are Text(20)):
ccc_Something_Id__c
ccc_Somethingelse_Id__c

I'm trying to make a visualforce page and it's respective class that lets me modify / view the current value set to both of the fields.
This custom setting should be a single instance per each salesforce org. So an admin should be able to modify this setting (through the visualforce page) as well as view it's current value.

I've looked at sample solutions (1 (https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_custom_settings.htm), 2 (https://www.salesforce.com/us/developer/docs/pages/Content/pages_input_field_labels.htm), 3 (http://www.salesforce.com/us/developer/docs/pages/Content/pages_dynamic_vf_sample_standard.htm)) to this but am still uncertain of the syntax.

Summary:
Trying to make a visualforce page that displays (in a textbox) the current custom setting's fields which can be altered (after pressing a save button).
Arunkumar RArunkumar R
Inserting or Updating custom setting is similar to the object insert,update.

YourCustomSettingName__c customSet = YourCustomSettingName__c();
customSet.Name = 'Test';
insert customSet;


Put your mandatory fields and change the above code according your requirement...!