hanslokhoff
12th February 2003, 20:41
Hi all,

I am creating this (multi.occ) session using my own main.table

In some cases I want to db.insert another(!) record

(This rec. has 'NOTHING' to do with the set of rec's I'm working in right now, so I don't want to see it, but add it to the main.table anyway.)

In fact, I'd prefer to db.insert this rec. at

Main.table.io:
Before.write:

My problem is: How do I db.insert a new rec to the main.table and STAY in the set of rec's I see in my form?

For now, if I have set the new values for my db.insert, this has effect on the set of occurrences in my form.

Can I use an ALIAS or something for my main.table which I can use for db.insert/db.update too ?

Can anyone point me in the right direction?

Thanks a lot guys.
Regards,
Hans.

gous99
12th February 2003, 21:07
HI, if I understand your problem correctly, you want want to use the on.main.table() function.

Basically, it save the record you are in and reset it once you executed the function you are calling.

Sample:

on.main.table(insert.main.table)



function insert.main.table()
{
any code
any code
db.insert(ttable)
etc......
}

Hope this helps.

hanslokhoff
13th February 2003, 11:48
Thanks !
I think this is what I was looking for.
Hans.