syllepage
15th October 2010, 19:39
Hi,

I'm using a multi-occurence form and one field that is part of my index is only display.

When i add.set the field is initialize correctly and when i finished entering the record i want to be able to save record and force another add.set.

I tried to do an execute(update.db) on the after.input or after.field of the last field on the occurence, but this not allowed.

Where or how can i do it ?

Thank You,

mark_h
18th October 2010, 16:08
Never tried this myself. How do you know they are at the last occurence? I mean they could input 6 or 10 or even 20 records? The thought that crosses my mind is they hit the save button. That saves all the data and then you could try to force it to execute(add.set). Is add.set what you really want? Or is it start.set?

syllepage
18th October 2010, 18:38
The add.set is what i want, but i would be able to do the save data automatically instead of pressing the Save button.
I mean do the save after i added a record.

mark_h
18th October 2010, 21:49
So you want to force a save after adding one record correct? You can try the before.display on first field - execute(update.db), execute(add.set). Wish my help worked on the windows 2007 laptop - but I can't get into my old help files, Plus I can't even add programs to read it.

baan_fun
18th October 2010, 22:06
Hello,
I think that on after.field section of the last field, you should call commit.transaction() because the record is already locked.
Then in the section after.update.db.commit: call execute(add.set)

choice.update.db:
before.choice:
whatever you have here

after.update.db.commit:
execute(add.set) |this will be called each time a commit was done

mark_h
18th October 2010, 23:15
Just thought of something - how would you ever get out of insert mode? In either solution.

mark_h
18th October 2010, 23:30
Got it - you could set a flag for when a user hits insert or add.set, as long as the flag is on you keep doing execute(update.db), execute(add.set). Then when they hit save it turns the flag off and skips the execute statements.

baan_fun
19th October 2010, 09:34
yes, this is also how I thought about. On choice.add.set or duplicate.set set flag automatic.add = true.

On the choice update.db: set the flag on false

Then. in after.update.db.commit: