VishalMistry
17th May 2016, 18:13
Hi all,
Is there any way to change a form field to a field with enum values dynamically.
e.g.
based on condition particular field contain enum values of tcyesno domain (tcyesno.yes and tcyesno.no).
The reason for doing this is i have a session which, given a table code exports data of the table. In this session user can give selection criteria.
Any help will be highly appreciated.
Vishal
Ajesh
17th May 2016, 18:34
Why dont you put both the fields on form and based on your condition, enable one field and disable other or disable one field and enable one field.
Just my Opinion.
VishalMistry
18th May 2016, 09:23
Hi Ajesh,
Based on the table selected, the enum can be of any type. It can be tcyesno tgyenox or order status or anything else. Possibilities are endless.
This is the reason for asking. Do you have any clue ?
Vishal
bhushanchanda
18th May 2016, 12:30
If on LN, go ahead and use Programmable Dialog in this case instead of a session. You can do all the things required on the fly.
Programmable Dialog Example (http://www.baanboard.com/programmers_manual_baanerp_help_functions_programmable_dialogs_example)
Ajesh
18th May 2016, 12:48
Hi Vishal
I want to further understand if you dont mind.
How are the enum types related to the table being exported? What is the relation between them?
VishalMistry
18th May 2016, 12:48
Hi Bhushan,
I used to work on ERPLn some six months back, now I am working on Baan IV.
Vishal
mark_h
19th May 2016, 16:12
Nothing I know of does it dynamically in 4c4. Never does this myself, but I guess you could have something that is text string - like a generic enumerated list. Then read thru the list of enumerated values for the selected field use something like set.enum.values to set the text values. Not even sure something like that would work with a 4c4 form. But you could test it by creating a new enumerated domain with text and maybe 4 values (1,2,3,4) then in the code (maybe in before.display) use set.enum.values set it to like "YES","NO","MAYBE","YOU GOTTA BE KIDDING". Then run the session and see if the drop down gives you those options instead. I have never really used set.enum so I am not sure if it lets you change them or not.