We have a Multi Select Fix Choice List and we want to take all the items that get selected and arrange them one under another in a formula field.
This is the formula field code.
def result= []
def string_val
def v_displayValues = getSelectedListDisplayValues(‘<API FCL>’)
if(<API FCL>!=null){
for(int i = 0 ; i<v_displayValues.size();i++)
{
if(i == 0)
result.add(” “+v_displayValues[i]+“\n”)
else
result.add(v_displayValues[i]+“\n”)
}
string_val = substringAfter(substringBefore(result.toString(),‘]’),‘[‘)
}
else
{
string_val = “”
}
def newString = string_val .replaceAll(‘,’,”)
return newString