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
RadDude89RadDude89 

Picklist values disappearing

Hi,

We have visualforce pages in SF which contain 3 picklists, see code below.
<apex:inputField value="{!newLead.Site_County_1__c}" />

Something strange is happening for these fields, when a user has the field populated and then opens the record to edit and save. the values have disppeared when they save it again.

Has this happened to anyone before?

Best Answer chosen by RadDude89
RadDude89RadDude89

Thanks for the help guys but I found the solution.

On our apex class I had the site_county_1__c set up as newLead.Site_County_1__c=newLead.Site_County_1__c
instead of newLead.Site_County_1__c=currLead.Site_County_1__c

All Answers

bob_buzzardbob_buzzard
Do you have record types enabled for leads - that would allow different picklist values based on the record type.
Amber090Amber090
I'm running into the same issue, but it's not just for picklists.  It's for all fields that a user needs to edit & save.  The new values do not save for the VF page.
Amber090Amber090
Just found the issue!  Check your Save Button command.  This was mine:
<apex:commandButton value="Save" action="{!savepage}"/>

When I removed "page", it resolved the issue completely!
<apex:commandButton value="Save" action="{!save}"/>
RadDude89RadDude89

Thanks for the help guys but I found the solution.

On our apex class I had the site_county_1__c set up as newLead.Site_County_1__c=newLead.Site_County_1__c
instead of newLead.Site_County_1__c=currLead.Site_County_1__c

This was selected as the best answer