If you have a layout_field that is formatted with a checkbox, radio button, etc. control style and accidentally drag and drop text on in, you can wind up with values in the field that you can NOT see.
What do we think about this as an auto-enter calc to match the valueList and optionally the number of allowed valueListItems ?
Let (
[
~value_list = @valueListNameFromID ( "" ; 102 ) ;
~value_list_items = ValueListItems ( "" ; ~value_list ) ;
~filterValues = FilterValues ( Self ; ~value_list_items ) ;
~number_of_choices_allowed = 2 ;
~filterValues.allowed = RightValues ( ~filterValues ; ~number_of_choices_allowed ) ;~filterValues.allowed.length = Length ( ~filterValues.allowed ) ;
~filterValues.allowed.trimmed = Left ( ~filterValues.allowed ; ~filterValues.allowed.length - 1 ) ;
~result = ~filterValues.allowed.trimmed
] ;
~filterValues.allowed.trimmed
)
/////////////////
CF: @valueListNameFromID ( valueList.ID )
Let (
[
~the_ValueListIDs.padded = ¶ & ValueListIDs ( "" ) & ¶ ;
~a_ValueListID.padded = ¶ & valueList.ID & ¶ ;
~position = Position ( ~the_ValueListIDs.padded ; ~a_ValueListID.padded ; 1 ; 1 ) ;
~list.padded.left = Left ( ~the_ValueListIDs.padded ; ~position ) ;
~index = ValueCount ( ~list.padded.left ) ;
~a_valueListName = GetValue ( ValueListNames ( "" ) ; ~index ) ;
~result = ~a_valueListName
] ;
~result
)
/////////////////
Here is some background reading: