pcolombo
10th February 2005, 21:20
Hi Guys :
Im a newbie using DAL functionality and have couple of questions about it:
1)Can i Activate/Deactivate DAL functionality into program scripts (like you can do in ttaad4100).
2)If yes . What is the way to do this?. I tried to search for specific instruction in Baan Help manual but found nothing
Thanks in advance :)
lbencic
10th February 2005, 21:41
Hi -
The DAL is always active in sessions, acting on the main table.
To access it yourself when doing programming, use the dal.* functions, as described in the programmers guide.
Here's a WIKI Link (http://www.baanboard.com/programmers_manual_baanerp_help_functions_dal_overview) to the DAL Overview section of the Guide. Basically, change some coding to use the DAL methods instead of the standard methods.
1. Use Property Methods to assign values
Instead of assigning a table field value = your value, use the dal.set.property(..) method
2. Use Data Access Methods:
Instead of using db.insert to insert a record, use the dal.new(....) method
Instead of using db.delete to delete a record, use the dal.destroy(...) method (my personal favorite)
Instead of db.update to modify, use dal.update(...)
3. Use 'Hooks' to call the field property methods and the Object methods as needed (before.save.object, etc) as needed.
4. Use dal.start.business.method to access external functions in the DAL's.
If you use the old db.* statements, the DAL is not called.
Read the overview and related links, let us know any more specific questions if you have them.
Good luck!
pcolombo
10th February 2005, 23:44
Thanks Ibencic, now im absolutly clear about you can't activate or deactivate DAL via program scripts. I'll continue research this functionality.
The only doubt i get is . What is the way that ttaad4100 do this?. I suppose is "special" Baan session , but finally is a session too.
:)
Regards
lbencic
11th February 2005, 00:10
Yes, it's a session, but I have never seen the source to see how it does that. They clearly have some method in the standard program they can turn it on and off with, they also allow you to use/not use the DAL while doing Exchange imports. But I have not found a way to turn it off with the Session/4GL Main Table logic. In 3GL programming, you have the control with the dal.* vs. db.* calls.
shaboo
11th February 2005, 01:27
Can't remember exactly but wasn't there a table 'ttadv889' (or something like that) which controls the activiation/deactivation of DAL?
Evert-Jan Bosch
14th February 2005, 16:57
table ttadv889 is only used icw BOI's.