Bastien
12th June 2003, 13:31
Hello,

In a specific program script, I attempt to create a new record in table whinh201 by using DAL.NEW with the check property flag set to yes. Fields of whinh201 were previously filled directly with their new values.

whinh201.oorg = xxx
whinh201.orno = xxx
...
dal.new("whinh201",twhinh201,dal.error,true,db.retry)

By using this syntax, I often get an error 205. The weirdest thing is that it doesn't happen all the time ...

If now, I use the dal.set.property.with.check() function to fill the whinh201 fields and then insert the record with DAL.NEW without property check, and it always works:

dal.set.property.with.check("whinh201", twhinh201, "whinh201.oorg", xxx)
dal.set.property.with.check("whinh201", twhinh201, "whinh201.orno", xxx)
...
dal.new("whinh201",twhinh201,dal.error,false,db.retry)

I really don't understand why!!

My colleagues have had similar problem, but this time, the error 205 occurs in a standard DAL, without any customization ... I assume this problem could come from Baan Tools or our system, but I have absolutely no clue ...

Does anybody of you have already encounter this issue?

Thank you in advance for your help.

Best regards.

lbencic
12th June 2003, 21:52
I'm not sure, but since no one has answered....

I think if you directly set the values, then it's possible the 'has_changed' flag for that field is not set...? The check sections query that flag often. If it's not set, your logic will act different on the dal new with checks, because it does not call those sections of code that rely on the 'has_changed' flag.

They recommend the dal.set.property method in all cases. If you want to do the dal.set.property and not the dal.set.property.with.check, then call the dal.new with check set to true, you should have the same results.

Bastien
13th June 2003, 12:14
Thank you lbencic for your reply,

That's definitely what I'm gonna do in the next developments.

I've noticed that Baan adviced to do so each time we have to add or update tables. But I find it weird the standard has not been 100% programmed this way ... and I still do not understand why the same error occured randomly in standard programs (on our current project) ... Far from discovering all the Baan subtleties ;)

Thanx anyway, have a nice day.