October 13, 20196 yr I have a Number field «Kontakttyp_enum». It contains multiple (!) number values, depending on what the user has deemed to select (see picture). It works great — numbers appearing and disappearing in this field, depending on which checkboxes are clicked upon. Now, I’d like to set this field with the «Set Field» script step — but I can’t figure out how. I can read specific values (for example with the function «Position ( Kontakttyp_enum ; 6 ; 1 ; 1 )», but I don’t know how to add or remove a specific number. Has anybody any insight on this? It’s quite interesting. Even though it is a number field, the numbers seem to be delimited by Return characters (¶) — at least this is the way the field content is displayed on the layout. But when I insert a return-delimited list, the checkboxes break. For example, when I insert «1¶2¶3», no checkbox is crossed. And when I then click a checkbox, the same number is inserted again. Thanks a lot for any hints! Gary
October 13, 20196 yr First thing: a field formatted as a checkbox set should be defined as a Text field, not a Number field. As you have correctly observed, the field contains a return-delimited list of selected values. Now, to add a new item to such field, you can do: Set Field ( YourTable::YourField ; List ( YourTable::YourField ; "new item" ) (Note that this assumes the item is not already checked - otherwise it will be duplicated.) 1 hour ago, gczychi said: when I insert «1¶2¶3», no checkbox is crossed. I am afraid I don't follow this part. If setting the field to the text string "1¶2¶3" does not result in 3 checkboxes being crossed, then your value list is defined to use other values - hard to tell from your screenshot. Edited October 13, 20196 yr by comment
October 13, 20196 yr Author 21 minutes ago, comment said: First thing: a field formatted as a checkbox set should be defined as a Text field, not a Number field. That did the trick! After I changed the field to text, everything works now as it should. And the problem inserting «1¶2¶3» was also related to the wrong field type. Thanks a lot!
Create an account or sign in to comment