ken bohnenkamp
17th September 2019, 18:03
Is there any way to add a temp field to the header section of a type 3 multi occurrence form. I have defined a temporary external field in my script but when I add it to the top of the form (it's not an occurring field) and then run the form, it shows the field fine but will not let me modify the field. Any help would be appreciated.

mark_h
17th September 2019, 23:17
Is it just not letting you enter information? Have you checked the form field type to make sure it can be modified.

günther
18th September 2019, 09:46
Hi,

maybe the function single.fields.on.mocc.form() can help. See e.g. http://baanboard.com/baanboard/showthread.php?t=7928

Regards
Günther

ken bohnenkamp
19th September 2019, 14:27
Yes, the field is marked as input, doesn't make a difference. Cannot edit the field. Does it have something to do with a type 3 form. Is it thinking the field is a key field ?

BaanInOhio
20th September 2019, 16:50
You're pretty limited on what you can do in the header of type 3 forms. If you add the field as an extern in the script and on the form as a single occurrence field in the header portion, you will be able to modify the field on the form and capture it in the check.input section for the field in your script only when a 'find' (bowtie button) is done. Otherwise, all fields in the header are set to read-only, including the local extern field.

Your best option is probably to add the new field as a 'display' single occurrence field in the header, add a specific option and a button with a label "change <fieldname>", and a choice section in the script to execute a session to enter/change the field. After.choice with a 'display' for the field keeps it current. Since you're on Baan4, you can try to replace the session with an input.string() call to capture the single field.



extern domain tcmcs.str6 test1
#pragma used dll "ottdllinputstr" | Required for 'input.string' call.

| set up user.0 special option and button in form. Add field in header as 'display'.

choice.user.0:
on.choice:
if (input.string("Title of input box", "Label for field", 6, 6, test1)) then
| numbers are length of string, number of visible fields.
after.choice:
display("test1")

ken bohnenkamp
20th September 2019, 17:35
Yes, thanks for your input. I am finding the limitations of the type 3 form to be exactly as you state. I figured there was no easy way to do what I want to do. So I am looking into other options to accomplish what I need to do. Again, thanks for your help.