checkboxes

I’m a bit lost at this one.

In the backend I have defined a field “functions” as an integer
the idea is to have (for starters) 3 possible values
1= project manager
2 = account manager
3= both

In the GUI I defined a valuelist having(project manager,account manager) attached it to the dataprovider “functions” and set this to displaytype “check”.

question 1: is this feasable ?
q2: what is the code to attach on recordshow?

something like
[pseudocode]
var x = getdataprovider value
case (x) of
1:check value “project manager”
2:check value “account manager”
3:check both values
end case
[end pseudocode]

q3:How do I evaluate the checked values on datachange

Any insights appreciated

You cound make yourself a tiny table with an id (1,2 and 3) and a text field for the text description (project manager, etc).

Then you can define a valuelist for you integer field, and let the user select text description, but you return the id to the field :-)

Yes, I know, thanks

This is more of an exercise, would be nice to spare lots of tables in future projects, if we could make this work.

Another way is to build the valuelists in code but then still the underlying field would need to be a textarea( so no integer)

The problem I think lies in the fact that there doesn’t seem to be a way of feeding back the clicked checkboxes to a method where I can evaluate the feedback and change to the desired integer

Hope this is still making sense. I think I’m to hard thinking the 4D way where a checkbox is an interface element to which you attach code to process when checked or unchecked

Any more ideas anyone?

why don’t you make a customvalue list with real and display values??

project manager|1
account manager|2
both|3