eric_s
9th July 2003, 13:03
Hi,

I'm having trouble with a multi-occurence screen.
At the end of each row there is a yes/no box which creates or deletes a record in another table.
With a lot of select for update 's I've minimalized the 206 fatal errors, but because I can't get the record to REALLY save when I switch to a new occurence the last input value of the yes/no field is remembered.
So when you hit the Save-button all the values for all occurences are correct, except the yes/no field doesn't 'refresh' with each occurence. If I ended with a 'Yes' al the No's I selected will be turned into a Yes when I hit the save button...

So I am trying to find some kind of function which saves my record after each occurence and not just at the end of the screen or when I hit save and save all occurences on screen.
Any ideas?

rupertb
9th July 2003, 14:22
Hi Eric try executing


execute(update.db)


somewhere in your script - possibly in the after.choice section of the standard option choice.modify.set

Regards,
Rupert

frigyesg
9th July 2003, 14:28
Hi,

because your yesno field is not part of the maintable, you have to store it in your own array, that you can check later for your actions. There is a predefined variable 'actual.occ' for this.

Here is an example:
Lets say you have 10 occurences in the form.


declaration:
extern domain tcyesno inp.yesno
domain tcyesno inp.yesno2(10)

field.inp.yesno:
after.field:
inp.yesno2(actual.occ) = inp.yesno

main.table.io:
before.rewrite:
if inp.yesno2(actual.occ) = tcyesno.yes then
| do something ...
endif

This code is of course not complete, but I hope you can see what I mean.

Hitesh Shah
9th July 2003, 18:39
In addition to what Frigyes told , u need not write db.retry.point and commit transaction in the function u call in before.rewrite section to avoid hitting 206.

Pilekes
9th July 2003, 18:51
(made my own account instead of using my colleague's)


Wow I read the last post wrong....
No db.retry.points or commit transactions... I'll have to look into that thnx ;)


But the array thing might just do the trick, so I'll ask eric_s to change that for me :)
And if he doesn't I'll change it in 3 weeks when I get back from a well deserved holliday :cool:

Anyways thanx in advance and I'll let you know if it works!

Pilekes
13th August 2003, 11:07
Well I've tried everything, but the only way it would work was by adding another field to the main table...
2bad, but hey at least it works now ;)