A) This works (restrict priorities to those with ID less than 5)
def allowedPriorities = constantsManager.getPriorityObjects().findAll{ it.id.toInteger() < 5 }.collectEntries { [(it.id): it.name] } priority.setFieldOptions(allowedPriorities)
B) This does NOT work (attempting to restrict priorities to only 1 & 3)
def allowedPriorities = constantsManager.getPriorityObjects().findAll{ it.id.toInteger() == [1,3] }.collectEntries { [(it.id): it.name] } priority.setFieldOptions(allowedPriorities)
Can someone please help me with why code snippet B does not work?
Thanks in advance,
Conor
Hi Conor,
If you want to get only priorities with ids 1 or 3 then the findAll closure should be
it.id.toInteger() in [1, 3]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.