baanguy2
15th June 2005, 21:57
I am trying to create an AFS script for logging hours and looks like I am missing something, guys help me here,
The parameter for the Hours Accounting Type (in HRA parameters) is set to Day/Employee).
script:
function afs.hra.records()
{
stpapi.put.field("tihra1101m000","tihra100.hrdt",str$(weekno)&str$(weekdno + 1)&str$(yearno))
stpapi.put.field("tihra1101m000","tihra100.emno",str$(empl))
rslt = stpapi.find("tihra1101m000",errm)
if rslt <> 1 then
stpapi.put.field("tihra1101m000","tihra100.hrdt",str$(weekno)&str$(weekdno + 1)&str$(yearno))
stpapi.put.field("tihra1101m000","tihra100.emno",str$(empl))
stpapi.put.field("tihra1101m000","tihra100.koht",str$(etol(tckoht.production)))
stpapi.put.field("tihra1101m000","tihra100.pdno",str$(tisfc001.pdno))
stpapi.put.field("tihra1101m000","tihra100.opno",str$(tisfc010.opno))
stpapi.put.field("tihra1101m000","tihra100.opcp",str$(etol(tcyesno.no)))
stpapi.put.field("tihra1101m000","tihra100.qucp","0")
stpapi.put.field("tihra1101m000","tihra100.qrjc","0")
stpapi.put.field("tihra1101m000","tihra100.pccp","0")
stpapi.put.field("tihra1101m000","tihra100.tano",str$(tisfc010.tano))
stpapi.put.field("tihra1101m000","tihra100.cwoc",str$(tisfc010.cwoc))
stpapi.put.field("tihra1101m000","tihra100.mcno",str$(mcno))
stpapi.put.field("tihra1101m000","tihra100.stdy",str$(etol(ltoe(weekdno))))
stpapi.enum.answer("tihra1101m000","tihras0044",tcyesno.no)
stpapi.put.field("tihra1101m000","tihra100.hrea",str$(shsfc001.mutm))
stpapi.put.field("tihra1101m000","tihra100.hrma",str$(shsfc001.rutm))
stpapi.put.field("tihra1101m000","tihra100.ckow",str$(shsfc001.cdis))
stpapi.insert("tihra1101m000",1,errm)
stpapi.enum.answer("tihra1101m000","tihras0071",tcyesno.no)
stpapi.end.session("tihra1101m000")
}
After the insert event I am getting an error "Employee's first date of employement is 01-01-05"
Please help me to find out what am I missing.
Thank You
The parameter for the Hours Accounting Type (in HRA parameters) is set to Day/Employee).
script:
function afs.hra.records()
{
stpapi.put.field("tihra1101m000","tihra100.hrdt",str$(weekno)&str$(weekdno + 1)&str$(yearno))
stpapi.put.field("tihra1101m000","tihra100.emno",str$(empl))
rslt = stpapi.find("tihra1101m000",errm)
if rslt <> 1 then
stpapi.put.field("tihra1101m000","tihra100.hrdt",str$(weekno)&str$(weekdno + 1)&str$(yearno))
stpapi.put.field("tihra1101m000","tihra100.emno",str$(empl))
stpapi.put.field("tihra1101m000","tihra100.koht",str$(etol(tckoht.production)))
stpapi.put.field("tihra1101m000","tihra100.pdno",str$(tisfc001.pdno))
stpapi.put.field("tihra1101m000","tihra100.opno",str$(tisfc010.opno))
stpapi.put.field("tihra1101m000","tihra100.opcp",str$(etol(tcyesno.no)))
stpapi.put.field("tihra1101m000","tihra100.qucp","0")
stpapi.put.field("tihra1101m000","tihra100.qrjc","0")
stpapi.put.field("tihra1101m000","tihra100.pccp","0")
stpapi.put.field("tihra1101m000","tihra100.tano",str$(tisfc010.tano))
stpapi.put.field("tihra1101m000","tihra100.cwoc",str$(tisfc010.cwoc))
stpapi.put.field("tihra1101m000","tihra100.mcno",str$(mcno))
stpapi.put.field("tihra1101m000","tihra100.stdy",str$(etol(ltoe(weekdno))))
stpapi.enum.answer("tihra1101m000","tihras0044",tcyesno.no)
stpapi.put.field("tihra1101m000","tihra100.hrea",str$(shsfc001.mutm))
stpapi.put.field("tihra1101m000","tihra100.hrma",str$(shsfc001.rutm))
stpapi.put.field("tihra1101m000","tihra100.ckow",str$(shsfc001.cdis))
stpapi.insert("tihra1101m000",1,errm)
stpapi.enum.answer("tihra1101m000","tihras0071",tcyesno.no)
stpapi.end.session("tihra1101m000")
}
After the insert event I am getting an error "Employee's first date of employement is 01-01-05"
Please help me to find out what am I missing.
Thank You