som.papai
23rd April 2008, 15:33
Hi all,

when i give Item Code then it take value from tcibd001 and put in to fmifo101table , but this is i am written in program Script.

field.fmifo101.item:
check.input:
select tcibd001.cuni,tcibd001.cwun
from tcibd001
where tcibd001._index1={:fmifo101.item}
selectdo
fmifo101.cuni=tcibd001.cuni
fmifo101.cwun=tcibd001.cwun
endselect

If i want to do the same things in DAl2,then which event method should i used?
function extern boolean fmifo101.item.check()
{
select tcibd001.cuni,tcibd001.cwun
from tcibd001
where tcibd001._index1={:fmifo101.item}
selectdo
tcibd001.cuni=fmifo101.cuni
tcibd001.cwun=fmifo101.cwun
endselect
}
Can i write in this way?
This will work?

dharam.dv
23rd April 2008, 16:03
Hello,

You need to write code in field.is.valid Event.

Regards
Dharam

fm_baan
24th April 2008, 07:02
Hi,
As I see the requirement is to set a default value for the field "fmifo101.cuni" and "fmifo101.cwun". This in DAL2 has to be done in the "field.update" section. So fmifo101.cuni.update should be used to set the default for that field.

If there are any checks to be done on the current field then we have to use the "field.is.valid" hook.

Hope this helps.

fm_baan

erdalmutlu
1st May 2008, 10:35
Hi,

I have solved my problem by declaring

extern domain tftls.argt tftls015.argt
extern domain tcccur tftls020.ccur
extern domain tftls.tlid tftls020.tlid
extern domain tcntdt tftls020.vodt

in the report script. Thank you.

Best regards.
Erdal Mutlu

Marioth
1st May 2008, 11:37
Is it me or do I miss something???????????????????????

Mario

vahdani
5th May 2008, 12:51
Hi,

to Marioth first: Don't worry! Your sanity is intact ;). Mutlu has apparantly posted to the wrong thread.

To som.papai: You should have used the "when.field.changes:"-section and not "check.input:". You are basically giving the user help and support by data entry. Such support functions belong in the User interface (Session script) and not in DAL. DAL should only contain business logic and nothing else.