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
Geetanjali Sharma 9Geetanjali Sharma 9 

Hi To Everyone, .

Hi To Everyone,

I am new to salesforce so not much aware about all the apex class coding and visula force. so sorry if i am asking something is silly.

My issue is that.
I have created custom object sat name Registration where i have created 1 field name "Profile_Form" .
now on  Registration layout i want to show all Profile list (profile that we craeted in user) on field "Profile_Form" to select. 
If i am using picklist, there i can list out onlt current available all profile list ,but in future  new profile could be added and old could be edited ,in that condition custom picklist will not work.

So i want the way to show list of all profiles on my custom field.


Please suggest.

​Thanks in advance,
Jesus Lorca AppsJesus Lorca Apps

Hi,

 

You have to create a VF page for that.


in the controller you need a method like this:

public List<SelectOption> getProfiles() {

List<SelectOption> profiles = new List<SelectOption>();

// Logic to query profiles and store key-value in the list of Select options


return profiles;
}

 

Then in the VF page you need something like this:

<apex:selectList value="{!selectedProfile}" size="1">

<apex:selectOptions value="{!Profiles}"/>
</apex:selectList>

Geetanjali Sharma 9Geetanjali Sharma 9
Thanks Jesus for suggestion but I don't need this to on VF page. Instead I need this list as picklist or lookup on Salesforce layout.