Developer forum

Forum » CMS - Standard features » Update user objects to see newly created checkboxes

Update user objects to see newly created checkboxes

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Guys,

I have a bunch of users defined in the system. i have added a new Custom field of type checkbox.

The problem I have is the field does not seemt to be recognized in the template unless I save the user.

it might mbe some sort of caching going on.

Is there any way to update all users or to update the information in order to access those new fields in the template?

The error I get is "String was not recognized as a valid boolean"

I am using 8.9.1.13

Thank you,

Adrian


Replies

 
Nicolai Pedersen
Reply

Hi Adrian

There is no value until the user is saved - no neat way to do that, except for each user in user.getallUsers(), user.save() ish. But that will give you exceptions again later.

Better make a check - or use Base.ChkBoolean to ensure you get a valid boolean out of it.

You can also check for the nullable - by doing something like @GetBoolean("customfield")?.value

 

You must be logged in to post in the forum