richen
16th January 2007, 15:35
I want to make a pulldown formfield. I want give the user only 2 options.

Example:

Factory : Factory 1
Factory 2

Factory 1 and Factory 2 in a pulldown field.

mark_h
16th January 2007, 15:44
Just create an enumerated variable.

richen
16th January 2007, 16:41
Hallo can you give me an example. How to declar it etc.

mark_h
16th January 2007, 17:01
Go into maintain domains ttadv4100m000(maintain domains). On form 2 select the data type and the length. Then click on the enum set data on the bottom of the screen.

en@frrom
17th January 2007, 13:22
I personally am not a big fan cretaing new domains for every dropdown list you want to place on a form. There are plenty of ways to get to a solution without having to create new domains. In your case of just two enum-values, you could opt for 2 plain tcyesno-fields, when the one is clicked, automatically the other one is selected, you could also have a little zoom session to a new form, or even place an object on the form which lists the textual-values from a text-file.

These are all just ideas; point is that I personally prefer all the above rather than creating new domains for these purposes.

Regards,
Eli Nager

bigjack
17th January 2007, 17:07
Hi Eli,

Im curious to know why do you avoid creating enums? I mean all the alternate methods you mentioned would require a programming effort. Why do you opt for them.

Cya

NPRao
17th January 2007, 22:47
BigJack,

There are few advantages and disadvantages of using enums:

It is good to use enum for generic design in table/domain structures, so you would also get the enumerate labels translated to other languages.

Any change to enumerate domain, requires a runtime to be executed. In case of Windows a bounce of shared memory. On Unix, you can get away just logging out and logging back in depending on how you configured your shared memory parameters.

If you change the enum constant, the bdbreconfig does not changes the old constant value to the new one and you have to write your own data correction program.

Depending on your requirement you can simulate the drop down box using the BaaN standard function - set.list.values.for.field() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_form_and_form_field_operations_set_list_values_for_field) which is available from the BaaN-5 tools versions.

george7a
18th January 2007, 18:28
Hi,

If you don't want to use a new domain and you have more than two values, you can write the "legal" values in a text file on the Baan server and then make a session that will read this file and display it. The user then can zoom to this session and choose one of the legal values.

In the same time your main session can check if the value inserted by the user is legal or not.

I hope it helps,

- George