Baanboard.com

Go Back   Baanboard.com

User login

Frontpage Sponsor

Main

Google search


Poll
How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
18%
200 - 500 GB
26%
500 - 800 GB
3%
800 - 1200 GB
9%
1200 - 1500 GB
12%
1500 - 2000 GB
12%
> 2000 GB
21%
Total votes: 34

Baanboard at LinkedIn


Reference Content

 
Object hooks
By patvdv at 26 Feb 2008 - 21:56


Object hooks

Object hooks are used for checking the logic integrity of objects (that is, records in a table).

Object hooks replace the before.read, after.read, before.write, after.write, before.rewrite, after.rewrite, before.delete, and after.delete subsections in the main.table.io section of the UI script.

If there is a DAL for an object set, the 4GL engine calls the object hooks in the DAL every time that a DAM is executed for that object set. The object hooks perform the necessary checks to ensure the logical integrity of the objects being accessed. Any of the above mentioned sections in the UI script are ignored. So, if a UI script contains any of these sections, you must replace these by object hooks in the DAL.

Available object hooks

Return values and errors

Only the before hooks can prevent a database action. The after.get.object() hook can prevent a record from being sent to the UI. Both these types of hook block continuation of the calling method if the return value is set to DALHOOKERROR (a negative constant). If the return value is zero, the method continues.

The following table indicates how return values and error messages are handled. The STP column indicates how the 4GL engine reacts if a hook returns a DALHOOKERROR. The Messages column indicates what happens to messages when an error occurs. The Warnings column indicates what happens to messages when no error is returned. The DAM column indicates how Data Access Methods react when an error occurs.

Hook STP Messages Warnings DAM

before.open.object.set()

exit

display

display

return

before.get.object()

ignore

ignore

ignore

return

after.get.object()

skip

ignore

ignore

return

before.destroy.object()

return

display

display

return

after.destroy.object()

ignore

ignore

ignore

return

before.save.object()

return

display

display

return

after.save.object()

ignore

ignore

ignore

return

Related topics

0
No votes yet


All times are GMT +2. The time now is 08:46.


©2001-2018 - Baanboard.com - Baanforums.com