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

VF page problem on edit page



I have following 3 questions. Please help me if you can


I added VF page(with standard controller extension) on user page layout. It works fine on detail page. When I edit the user, this VF page does not render it's output. How can  I  use VF on edit page then?


Is it possible to add/update/delete picklist values from apex? I was only able to retrieve, but don't know how update.


I have custom controller, which I like to use instead of standard controller page for user object. How can I  configure my controller to be used for user objects?







#1)  You donot have any control over the edit page. You can only add VF page on detail page and not on the edit page.


#2)   I think it is not possible to add/update/delete picklist values from apex.


#3)   If you want to add a VF page, which is having a custom controller, on User object, then associate an URL with your custom link and that URL should be your VF page's URL.


public List<SelectOption> getTypeStructure() { List<SelectOption> options = new List<SelectOption>(); options.add(new SelectOption('','--None--')); options.add(new SelectOption('Business Partnership','Business Partnership')); options.add(new SelectOption('Charity','Charity')); options.add(new SelectOption('Colleagues','Colleagues')); options.add(new SelectOption('Family','Family')); options.add(new SelectOption('Friends','Friends')); options.add(new SelectOption('Government','Government')); options.add(new SelectOption('Husband & Wife','Husband & Wife')); options.add(new SelectOption('Limited Company','Limited Company')); options.add(new SelectOption('Partners','Partners')); options.add(new SelectOption('Sharers','Sharers')); options.add(new SelectOption('Siblings','Siblings')); options.add(new SelectOption('Single Person','Single Person')); options.add(new SelectOption('Sole Trader','Sole Trader')); options.add(new SelectOption('Other','Other')); return options; }



<apex:selectList value="{!Structure}" size="1" id="values" title="test"> <apex:selectOptions value="{!TypeStructure}" /> </apex:selectList>




you can add value of picklist like this. but it is static.when you want to update any value you have to acange in apex code.