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
davidjbbdavidjbb 

Picklist remove.

Hello.

 

I need help removing all the picklist values from the following. I'm not sure how to do that. I want to be able to clear the selected picklist value then add a new one

 

 

jbbfc2__FieldworkersId__c = picklist field

mapWO = is a map



mapWO.get(v.id).jbbfc2__FieldworkersId__c = (remove all the values or unselect the value currently selected)

 

//add new value

mapWO.get(v.id).jbbfc2__FieldworkersId__c = v.Team_LeaderFWD__c;

Navatar_DbSupNavatar_DbSup

Hi,


You can use the clear method define inside the Map to Removes all of the key-value mappings from the map


For more details about Map methods please go through the link below:


http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_map.htm

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

davidjbbdavidjbb

I want to remove all the values from the jbbfc2__FieldworkerIds__c. It's a picklist.

SamuelDeRyckeSamuelDeRycke

I don't think you can, or should be able to do that in code. 

 

If you want to globally and definitely remove the values from the picklist, you'll need to update the fieldworkerIds__c field itself. What are you trying to do that would require you to change the picklists values ? Maybe you could consider useing a lookup relation to another object.