matigro
22nd October 2009, 20:52
Hello, I've a problem, I want to check consistency of dates between periods, but I need to do it via DAL.
So I run a select in after.save.object() checking record1.end.date and record2.start.date
I think I could do it just after last record change is saved in table, so I need to know how many changes in records of my table have been done.
LN knows it :) and I want to know if there is a function or variables that I could use.
ie: I have a 8 records in my table, I changed 3 of them and LN calls after.save.object() 3 times, with 1 of the records changed as current.
Hope you understand my problem, thanks in advance for any answer I'll get.
mark_h
22nd October 2009, 21:00
Just wanted to let you know this is the forum for questions like this. The code and utilities forum is for code you wish to share with others. I do not have any experience working with DAL. Good Luck!
matigro
22nd October 2009, 21:16
Hello mark_h, sorry for posting in a wrong forum. Thanks to move it to an according one.
_Ralph_
23rd October 2009, 15:07
You can use the fuction with.old.object.values.do()
Than you can store the old field's value on a variable to compare with the current field value.
matigro
28th October 2009, 15:06
You can use the fuction with.old.object.values.do()
Hi _Ralph_, thanks for your comment and I tried to use this function but get same problem.
After trying a lot of functions, I fix it!
I fixed it mapping changes in table fields with a table in memory (array) which was (year, period, date.from, date.to) with an entry for each record in table and saving new dates in this table.
When a new value of field was saved, I use it from table (in after.save.object). If field was still not saved to table, it use array fields to validate dates.
After doing this, I was told that there is functions, non-documented, called idb, in tccomdll0201, that does almost the same as I did with the array :(
But, script was running ok so... why touching it and break all? :D
Thanks very much for your attention.
Now I know this two new functions: with.object.set.do() and with.old.object.values.do() and it will be used when necessary. ;)
rberti
28th October 2009, 16:06
Just don't forget that "with.old.object.values.do()" must be called in "before.save.object()", other way won't work properly. ;)
Now, the" handle cash memory functions" (idb) are used in process that demands to much IO, that is, inserts and reads. So you can use the memory tables to improve performance, controling it by idb funcions... At least it's what a found about it.
Gurus please correct-me if I'm wrong!
Regards!