~Vamsi
1st February 2002, 21:14
What is "subdal"? Definitely a BaanERP functionality. Totally undocumented but being used in a few "ts" scripts. Its usage looks like
if subdal then
foo()
endif
At runtime there is no value in the debugger!
Kees de Jong
3rd February 2002, 00:09
Which script(s)
I do not know this feature. Isn't it a variable, declared in the source itself?
Can you name at least one script in which this 'subdal' is used? I will look into it.
lbencic
4th February 2002, 18:08
Well - doesn't seem like anyone knows for sure, so I will take a guess. It is probably a predefined variable indicating if the DAL has been called from another DAL or not. You find it only in DAL's...tssoc200, tssoc220, tsspc212, tsspc111. The best proof is in tssoc220, where the "subdal" variable has been replaced by a variable "update.from.soc200". This would seem to indicate the program needs to know if it was called from another DAL - and in this case specifically from the DAL tssoc200.
~Vamsi
4th February 2002, 20:55
baan5user, Lisa mentioned the scripts.
Lisa, I had thought the same thing as you said. But me and my colleague were not able to make it work in such a fashion. When a DAL was fired from a different session(whose main table was not this DAL), the condition would still not become true :(. Is this a bug? A very interesting thing about the whole situation is that subdal does not get a value. I was wondering if it is a macro.
NPRao
5th February 2002, 19:13
Hi Vamsi,
I know the developer who has used that subdal in TS package. So he sent me more info -
Regarding the subdal, during the program execution the subdal will be true if some dll calls the DAL.The subdal will be false if the program is DAL itself. This is not documented anywhere.The meaning of this variable is speaking (sub)dal.
I also got a reply from another guy-
SubDal .... It's a spicy dal being served at SubWay (--Joke)
lbencic
5th February 2002, 19:39
Well - that's interesting. So..from any library it will be true, but from within the DAL, it is not. What about the main UI Scripts? They make calls directly to the dals sometimes (Start Business Method...) How does this flag react to that?
Also, I have to say, I see problems with this method. For me, I write a lot of straightline libraries that are supposed to mimic the sessions. I find that not all pieces of the DAL are called when I do updates using the DAL SET PROPERTY/DAL UPDATE methods(Such as After Update DB!?! :confused: ), so I make direct calls to the dals to accomplish this. If the dal is going to react different depending on what type of script calls it, it will cause problems. Especially for those without source code that will not get to debug and find out why.
I hope they limit their use of this to the TS package - I do little work in that area :p
alkreddy
6th February 2002, 13:42
The explanation given is not 100% correct.
Further, SUBDAL is not to be used by Baan application developers. I suppose its meant to be used for tools development
learner
22nd March 2007, 20:12
Hi,
Its regarding subdal which is causing a problem to me.
I have created a new session which actually updates Price books , creates a entry in Price Book by Item. My session code is
tccus0231m000, now it contains a function which is insert.in.standard.price.books(some parameters) as mentioned below
function domain tcbool insert.in.standard.price.books(domain tdpcg.prbk i.prbk,
domain tcitem i.item,
domain tcccur i.ccur,
domain tcpric i.bapr,
domain tccuni i.prun,
domain tccuni i.cuni)
{
domain tcmcs.long ret.new
dal.reset.error.messages(0)
ret.new = dal.set.property("tdpcg031",ttdpcg031,"tdpcg031.pbor",tdpcg.pbor.stnd,DAL_NEW)
ret.new = dal.set.property("tdpcg031",ttdpcg031,"tdpcg031.prbk",i.prbk,DAL_NEW)
ret.new = dal.set.property("tdpcg031",ttdpcg031,"tdpcg031.item",i.item,DAL_NEW)
ret.new = dal.set.property("tdpcg031",ttdpcg031,"tdpcg031.curn",i.ccur,DAL_NEW)
ret.new = dal.set.property("tdpcg031",ttdpcg031,"tdpcg031.miqt",0,DAL_NEW)
ret.new = dal.set.property("tdpcg031",ttdpcg031,"tdpcg031.efdt",eff.date,DAL_NEW)
ret.new = dal.set.property("tdpcg031",ttdpcg031,"tdpcg031.qtun",i.cuni,DAL_NEW)
ret.new = dal.set.property("tdpcg031",ttdpcg031,"tdpcg031.exdt",0,DAL_NEW)
ret.new = dal.set.property("tdpcg031",ttdpcg031,"tdpcg031.endt",utc.num(),DAL_NEW)
ret.new = dal.set.property("tdpcg031",ttdpcg031,"tdpcg031.bapr",i.bapr,DAL_NEW)
ret.new = dal.set.property("tdpcg031",ttdpcg031,"tdpcg031.prun",i.prun,DAL_NEW)
ret.new = dal.set.property("tdpcg031",ttdpcg031,"tdpcg031.dsor",tdpcg.dsor.stnd,DAL_NEW)
ret.new = dal.set.property("tdpcg031",ttdpcg031,"tdpcg031.dssc","",DAL_NEW)
ret.new = dal.set.property("tdpcg031",ttdpcg031,"tdpcg031.quon",tcyesno.no,DAL_NEW)
ret.new = dal.set.property("tdpcg031",ttdpcg031,"tdpcg031.dfpb",tcyesno.yes,DAL_NEW)
dal.new("tdpcg031",ttdpcg031, dal.error.code, 1, db.retry, DB.RETURN.ERROR)
if dal.error.code = 0 then
return(true)
else
err.mesg = ""
dal.get.error.message(err.mesg)
abort.transaction()
dal.error = dal.error & err.mesg & "|"
upd.reval.table()
return(false)
endif
return(false)
}
Now issue is that i delibarelty want tdpcg031.dfpb ( Default Price Book ) to be YES, for that although i have set that in my UI script.
ret.new = dal.set.property("tdpcg031",ttdpcg031,"tdpcg031.dfpb",tcyesno.yes,DAL_NEW)[\code]
but still it doesnt do, once a entry is created in tdpcg031 ,i can see the record contains Default Price Book field as 'No' and possibly the reason is that within DAL of tdpcg031 in before.save.object its written something like
[CODE]
function extern long before.save.object(long i.mode)
{
if i.mode = DAL_NEW and
not subdal then
tdpcg031.dfpb = tcyesno.no
endif
return(0)
}
so what is happening everytime it goes and sets the field tdpcg031.dfpb back to "No" where as i want it as "Yes", can i do something about this variable subdal, which might be false in my case and causing the before.save function to execute. I would prefer not to modify DAL of tdpcg031.
How do i handle this situation ?
Waiting for your reply.
Regards
Learner