You need to sign in to do that
Don't have an account?
bensondaniel
Multiselect Picklist
Can anyone help me with Itereating through a multiselect picklist?
I need to make a list of all entries using a for loop.
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
Can anyone help me with Itereating through a multiselect picklist?
I need to make a list of all entries using a for loop.
I am not sure what is your actual requirement, but hope this helps!
Test is a custom object and PickListMulti is a custom field on it.
trigger tstObject_beforeUpd on Test__c (before update) {
for (Test__c t : trigger.new)
{
String[] plmVal;
plmVal = t.PickListMulti__c.split(';');
for(String strg: plmVal)
{
System.debug('-------------------------------------------->' + strg + '#');
}
}
}
Can You Please explain what do you want?
Do you want this vf pages.
Find below a sample code to get multiselect picklist values iterate through for loop.
VF Code:
<apex:SelectList title="issue1" value="{!SkilVal}" multiselect="true">
<apex:selectOptions value="{!Skill}"/>
</apex:selectList>
Controller Code:
public String[] skilVal = new String[]{};
public String[] getSkilVal()
{
return skilVal;
}
public void setSkilVal(String[] skilVal)
{
this.skilVal = skilVal;
}
if(skilVal.size() > 0)
{
for(Integer i=0; i<skilVal.size(); i++)
{
if (i == 0)
{
strskil = skilVal[i];
}
else
{
strskil = strskil + ';' + skilVal[i];
}
}
System.debug('------ Picklist values --------' + strskil);
}