You need to sign in to do that
Don't have an account?
Rajesh SFDC
how to get all proflies and display in dropdown using visualforce and apex class
please send the sample code...
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
please send the sample code...
Hi,
You can use the following sample of code.
===VisualForce Page===
<apex:page controller="Test">
<apex:form >
<apex:selectList size="1" value="{!selectedProfile}" >
<apex:selectOptions value="{!ProfileOptions}" />
</apex:selectList>
</apex:form>
</apex:page>
====Controller====
public with sharing class Test {
public String selectedProfile {get; set;}
public list<Selectoption> getProfileOptions() {
list<Selectoption> profileOptions = new list<Selectoption>();
list<Profile> profileList = [select Id, Name from Profile];
for (Profile profile : profileList) {
profileOptions.add(new SelectOption(profile.Name, profile.Name));
}
return profileOptions;
}
}
If it solves your problem please mark it as a solution.