mast_aadmi
7th January 2010, 15:05
Hi,
Is there any way to include a drop down list on a form created using the infor form editor without using a enumerated domain?

NPRao
7th January 2010, 21:12
Refer to the tools functions -

set.enum.values.for.field() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_enumerates_set_enum_values_for_field)

set.list.values.for.field() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_form_and_form_field_operations_set_list_values_for_field)

set.enum.array.for.field() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_enumerates_set_enum_array_for_field)

mark_h
7th January 2010, 21:26
There is also some threads on this in this forum. I have done a couple of searches but cannot find them. As soon as I do I will post a link, but it has been discussed previously with some examples included.

mark_h
7th January 2010, 21:34
Okay search for listbox to get a bunch of threads. This is just one of the threads (http://www.baanboard.com/baanboard/showthread.php?t=13029&highlight=drop) I found.

mast_aadmi
8th January 2010, 07:27
thanks a lot for your quick replies. i had tried to search in the thread. i just couldn't find any so i created a new thread.

Thanks again.

sameer.don
8th January 2010, 08:49
Hi,
funcitons like "set.enum.values.for.field()" work with fields having enumerated doamains, and this function filters out of existing list.

But you can try using functions:

long
get.object ( long object_id [, long attribute,
ref value [, ref value] ] ... )

long create.object ( long type, long parent_object [, long
attribute, value [, size] ] ... )


with object type = DsCdDListBox

May be you can use BaanHelp file for examples or search baan board for create.object() or DsCdDListBox

ulrich.fuchs
8th January 2010, 10:04
OK, here's the secret for Baan 6 (hidden functionality, no guarantee this method's always gonna work in the future):




| Create a drop-Down-List when the user zooms on a field:

#include <bic_tt>

field.x:
before.zoom:
if listbox.selection () then
input.again()

endif

| Otherwise the regular zoom happens here



functions:
function domain tcbool listbox.selection () {
long choice.copt
string optiondescriptions.tab (1,1,999) based

domain tcmcs.st40m optiondescriptions.tab (100)
domain tcmcs.st40m fieldvalue.tab(100) | Must have Domain of Field x
long max.copt.i
| Create arrays, one with the values shown in the box, one with values to return to the field:
optiondescriptions.tab = ...
fieldvalue.tab = ...
max.copt.i = <number of records in those arrays>


| Add an additional option - if this one is selected, the regular zoom starts
max.copt.i = max.copt.i + 1
optd.tab(1,max.copt.i) = "..."

| Now here's the magic word:
choice.copt = handle.listbox(0,0, max.copt.i, optiondescriptions.tab)
if choice.copt = max.copt.i then
return (false) | "..." selected -> do the zoom
endif
if choice.copt > 0 then
field.x = fieldvalue.tab(1, choice.copt)
endif
|* ESC pressed then return and don't zoom
if choice.copt = -1 then
return (true)
endif
return (false)
}

NPRao
9th January 2010, 03:34
You can also use the ttstpzoomlist but it is not guaranteed to work in Webtop. So it is better the 3 functions I listed in the previous response.

wait.and.activate( "ottstpzoomlist", |* Zoom list program
nbr.of.iterations, |* Number of items
0, |* Columns (or Pass zero)
0, |* Rows (or Pass zero)
current.window(), |* Current Window
saved.iterations.list) |* Selected item
if g.exit.menu then
std.route.it.id = saved.iterations.pu(1,g.exit.menu)
endif

mast_aadmi
9th January 2010, 08:07
thanks everybody. I got the set.list.values.for.field() to work. Thanks again.