sgoupil
23rd September 2010, 15:51
Hi,

Does anybody has a sample code where in a maintain session of course with a main table, when in modify mode, I would like to go and update another record within that same main table. I tried with on.main.table() but the commit and db.retry.point() seems to stop me. The on.main.table() seems to be good when reading another record but not when trying to update another record.

rberti
23rd September 2010, 16:52
Hi,
It depends on wich event are you programming this update.
I'm not sure if on.main.table is needed if you are not wirting in the main table, but you can use db.retry.point and commit.transaction in 'after.update.db.commit' event, for example.
You can use also main.table.io events or after.save.object method in DAL (if baan V), without db.retry.point and commit.transaction functions.

Regards,

Rafael

rberti
23rd September 2010, 17:00
Oh, I've just read, it's another record in the main table... So, you can use on.main.table for UI events, but if you decide to use DAL 'after.save.object()' method, you will have to use 'with.object.set.do()' function.

mark_h
24th September 2010, 16:22
Hi,

Does anybody has a sample code where in a maintain session of course with a main table, when in modify mode, I would like to go and update another record within that same main table. I tried with on.main.table() but the commit and db.retry.point() seems to stop me. The on.main.table() seems to be good when reading another record but not when trying to update another record.

Well all you should really have to do is find and update the record. I believe the commit and retry will be handled by the maintain session. At least when I update other tables in on.main.table I do not include the commit and retry point commands. The problem I see is after the update, you need to go back to the original record - for display purposes. I guess that would depend on what you really needed.

Hitesh Shah
24th September 2010, 20:58
If u update other table in main.table.io / before.rewrite section without retry.point and commit , it will work . Search the forum with these keyword u may find many code sample.