sachinbaan
4th February 2015, 08:55
hi,
I am trying to add record through AFS in labor cost, but I am facing strange problem, I don't know whether there is problem in my code or something else,
but when first time I try to insert it gives error "enter value for employee field" even though value is there, now for the first time i inserted a record manually, and then tried with AFS , result is records are getting inserted.
function extern domain tcbool ltmig.commondll.tpppc2531m000.maintain.labor.cost(
domain tcemno i.emno,
domain tccprj i.cprj,
domain tcccp.yrno i.yera,
domain tcccp.peri i.peri,
domain tppdm.cspa i.cspa,
domain tppdm.cact i.cact,
domain tppdm.task i.task,
domain tccpcp i.ccco,
domain tcckow i.cwgt,
domain tppdm.aalc i.amoc,
domain tcdate i.rgdt,
domain tcccp.yrno i.cyea,
domain tcccp.peri i.cper,
domain tcemm.grid i.eunt,
domain tcccur i.ccur,
ref domain tppdm.serd i.serd,
ref string err.msg)
{
string s.sern(3)
stpapi.put.field("tpppc2531m000", "tpppc231.year", str$(i.yera))
stpapi.put.field("tpppc2531m000", "tpppc231.peri", str$(i.peri))
stpapi.put.field("tpppc2531m000", "tpppc231.emno", i.emno)
ret = stpapi.change.view("tpppc2531m000", err.msg)
if isspace(err.msg) then
ret = stpapi.synchronize.dialog("tpppc2531m000", "ADD", err.msg)
if ret = 1 then
stpapi.put.field("tpppc2131s000", "tpppc231.year", str$(i.yera))
stpapi.put.field("tpppc2131s000", "tpppc231.peri", str$(i.peri))
stpapi.put.field("tpppc2131s000", "tpppc231.emno", i.emno)
stpapi.put.field("tpppc2131s000", "tpppc231.cprj", i.cprj)
stpapi.put.field("tpppc2131s000", "tpppc231.cspa", i.cspa)
stpapi.put.field("tpppc2131s000", "tpppc231.cact", i.cact)
stpapi.put.field("tpppc2131s000", "tpppc231.task", i.task)
stpapi.put.field("tpppc2131s000", "tpppc231.ccco", i.ccco)
stpapi.put.field("tpppc2131s000", "tpppc231.curc", i.ccur)
stpapi.put.field("tpppc2131s000", "tpppc231.cwgt", i.cwgt)
stpapi.put.field("tpppc2131s000", "tpppc231.amoc", str$(i.amoc))
stpapi.put.field("tpppc2131s000", "tpppc231.entu", i.eunt)
ret = stpapi.insert("tpppc2131s000", true, err.msg)
if ret = 1 then
stpapi.get.field("tpppc2131s000", "tpppc231.sern", s.sern)
i.serd = lval(s.sern)
stpapi.end.session("tpppc2131s000")
stpapi.end.session("tpppc2531m000")
return(true)
endif
endif
endif
stpapi.end.session("tpppc2531m000")
return(false)
}
I am trying to add record through AFS in labor cost, but I am facing strange problem, I don't know whether there is problem in my code or something else,
but when first time I try to insert it gives error "enter value for employee field" even though value is there, now for the first time i inserted a record manually, and then tried with AFS , result is records are getting inserted.
function extern domain tcbool ltmig.commondll.tpppc2531m000.maintain.labor.cost(
domain tcemno i.emno,
domain tccprj i.cprj,
domain tcccp.yrno i.yera,
domain tcccp.peri i.peri,
domain tppdm.cspa i.cspa,
domain tppdm.cact i.cact,
domain tppdm.task i.task,
domain tccpcp i.ccco,
domain tcckow i.cwgt,
domain tppdm.aalc i.amoc,
domain tcdate i.rgdt,
domain tcccp.yrno i.cyea,
domain tcccp.peri i.cper,
domain tcemm.grid i.eunt,
domain tcccur i.ccur,
ref domain tppdm.serd i.serd,
ref string err.msg)
{
string s.sern(3)
stpapi.put.field("tpppc2531m000", "tpppc231.year", str$(i.yera))
stpapi.put.field("tpppc2531m000", "tpppc231.peri", str$(i.peri))
stpapi.put.field("tpppc2531m000", "tpppc231.emno", i.emno)
ret = stpapi.change.view("tpppc2531m000", err.msg)
if isspace(err.msg) then
ret = stpapi.synchronize.dialog("tpppc2531m000", "ADD", err.msg)
if ret = 1 then
stpapi.put.field("tpppc2131s000", "tpppc231.year", str$(i.yera))
stpapi.put.field("tpppc2131s000", "tpppc231.peri", str$(i.peri))
stpapi.put.field("tpppc2131s000", "tpppc231.emno", i.emno)
stpapi.put.field("tpppc2131s000", "tpppc231.cprj", i.cprj)
stpapi.put.field("tpppc2131s000", "tpppc231.cspa", i.cspa)
stpapi.put.field("tpppc2131s000", "tpppc231.cact", i.cact)
stpapi.put.field("tpppc2131s000", "tpppc231.task", i.task)
stpapi.put.field("tpppc2131s000", "tpppc231.ccco", i.ccco)
stpapi.put.field("tpppc2131s000", "tpppc231.curc", i.ccur)
stpapi.put.field("tpppc2131s000", "tpppc231.cwgt", i.cwgt)
stpapi.put.field("tpppc2131s000", "tpppc231.amoc", str$(i.amoc))
stpapi.put.field("tpppc2131s000", "tpppc231.entu", i.eunt)
ret = stpapi.insert("tpppc2131s000", true, err.msg)
if ret = 1 then
stpapi.get.field("tpppc2131s000", "tpppc231.sern", s.sern)
i.serd = lval(s.sern)
stpapi.end.session("tpppc2131s000")
stpapi.end.session("tpppc2531m000")
return(true)
endif
endif
endif
stpapi.end.session("tpppc2531m000")
return(false)
}