ลองใช้แล้ว โดยแก้ไขจาก script ที่ อ.mn ให้ไว้ครับ (ตรงที่เป็นสีแดง)
var
  fvn,fcomputername,fdepartment,fhn : string;
  tc : TClientDataset;
begin
  showmessage('Example vn pre processing script');
  fvn:= GetGlobalValue('VN');
  fcomputername := GetGlobalValue('CURRENT_COMPUTER');
  fdepartment := GetGlobalValue('CURRENT_DEPCODE');
  showmessage('Current VN = '+fvn+'  , Computer Name = '+fcomputername+' , Department Code = '+fdepartment);
  fhn:=getsqldata('select hn from ovst where vn = "'+fvn+'"');
  if getsqldata('select count(*) as cc from opitemrece where hn = "'+fhn+'" and icode in ("1900072","1510054","1900071") ')>0 then
     showmessage('¼Ùé»èÇÂãªéÂÒ Aspirin');
end;
เกิด error ตามรูปครับ