Sample Code:
Visualforce Page:
<apex:page controller=”sample” sidebar=”false” >
<apex:form >
<apex:pageblock >
<apex:pageblockTable value=”{!code}” var=”c”>
<apex:column value=”{!c.Name}”/>
<apex:column value=”{!c.Code__c}”/>
</apex:pageblockTable>
</apex:pageblock>
</apex:form>
</apex:page>
Apex Controller:
public class sample
{
public List<CountryCodes__c> code {get;set;}
public sample()
{
Map<String,CountryCodes__c> allCodes = CountryCodes__c.getAll();
code = allCodes.values();
}
}
Output:
hi, I am getting this error after using this code
Error: customsetting Compile Error: Not of type Custom Settings at line 10 column 47
hi,
You go Develop->custom settings create new custom setting as CountryCodes and create this custom setting related fileds like Name(type text(42)), Code(type text(4)).After you execute this code…..
Superb
Great!
@great