rrankinmba
9th February 2010, 23:35
My script is not inserting a record in tfacp1120s000. The error is "Ledger account not allowed". I've been kicking this one around for too long so any help would be appreciated.
function domain tcbool add.transaction()
{
stpapi.get.field("tfacp1110s000", "tfacp200.ninv", save.ninv)
stpapi.get.field("tfacp1110s000", "tfacp200.lino", save.line)
stpapi.put.field("tfacp1110s000","tfacp200.ttyp", whntr500.ttyp)
stpapi.put.field("tfacp1110s000","tfacp200.appr", save.ninv)
stpapi.put.field("tfacp1110s000","tfacp200.ddue",str$(whntr500.docd))
stpapi.put.field("tfacp1110s000","tfacp200.ifbp",whntr500.ifbp)
stpapi.put.field("tfacp1110s000","tfacp200.isup",whntr500.isup)
retval = stpapi.find("tfacp1110s000", err.msg)
if retval <> 1 then
return(false)
endif
retval = stpapi.mark("tfacp1110s000", err.msg)
if retval <> 1 then
return(false)
endif
stpapi.handle.subproc("tfacp1110s000","tfacp1120s000","add")
stpapi.form.command("tfacp1110s000",5,"exec.cont.process",err.msg)
stpapi.put.field("tfacp1120s000","tfgld102.cono",str$(whntr500.comp))
stpapi.put.field("tfacp1120s000","tfgld102.year",str$(whntr500.year))
stpapi.put.field("tfacp1120s000","tfgld102.btno", save.btno)
stpapi.put.field("tfacp1120s000","tfgld102.ttyp",whntr500.ttyp)
stpapi.put.field("tfacp1120s000","tfgld102.docn", save.ninv)
stpapi.put.field("tfacp1120s000","tfgld102.line", save.line)
stpapi.put.field("tfacp1120s000","tfgld102.tcom",str$(whntr500.comp))
stpapi.put.field("tfacp1120s000","tfgld102.ccty",whntr500.ccty)
stpapi.put.field("tfacp1120s000","amount",str$(whntr500.amnt))
stpapi.put.field("tfacp1120s000","tfgld102.dbcr",str$(whntr500.dbcr))
stpapi.put.field("tfacp1120s000","tfgld102.vamt",str$(whntr500.vamnt))
stpapi.put.field("tfacp1120s000","tfgld102.ddue",whntr500.leac)
if check.dim1() then
stpapi.put.field("tfacp1120s000","tfgld102.dim1",whntr500.dim1)
stpapi.put.field("tfacp1120s000","tfgld102.dim2",whntr500.dim2)
endif
stpapi.put.field("tfacp1120s000","tfgld102.dim3",whntr500.dim3)
stpapi.put.field("tfacp1120s000","tfgld102.dim4",whntr500.dim4)
retval = stpapi.insert("tfacp1120s000",0,err.msg)
if retval <> 1 then
return(false)
endif
return(true)
}
function domain tcbool add.transaction()
{
stpapi.get.field("tfacp1110s000", "tfacp200.ninv", save.ninv)
stpapi.get.field("tfacp1110s000", "tfacp200.lino", save.line)
stpapi.put.field("tfacp1110s000","tfacp200.ttyp", whntr500.ttyp)
stpapi.put.field("tfacp1110s000","tfacp200.appr", save.ninv)
stpapi.put.field("tfacp1110s000","tfacp200.ddue",str$(whntr500.docd))
stpapi.put.field("tfacp1110s000","tfacp200.ifbp",whntr500.ifbp)
stpapi.put.field("tfacp1110s000","tfacp200.isup",whntr500.isup)
retval = stpapi.find("tfacp1110s000", err.msg)
if retval <> 1 then
return(false)
endif
retval = stpapi.mark("tfacp1110s000", err.msg)
if retval <> 1 then
return(false)
endif
stpapi.handle.subproc("tfacp1110s000","tfacp1120s000","add")
stpapi.form.command("tfacp1110s000",5,"exec.cont.process",err.msg)
stpapi.put.field("tfacp1120s000","tfgld102.cono",str$(whntr500.comp))
stpapi.put.field("tfacp1120s000","tfgld102.year",str$(whntr500.year))
stpapi.put.field("tfacp1120s000","tfgld102.btno", save.btno)
stpapi.put.field("tfacp1120s000","tfgld102.ttyp",whntr500.ttyp)
stpapi.put.field("tfacp1120s000","tfgld102.docn", save.ninv)
stpapi.put.field("tfacp1120s000","tfgld102.line", save.line)
stpapi.put.field("tfacp1120s000","tfgld102.tcom",str$(whntr500.comp))
stpapi.put.field("tfacp1120s000","tfgld102.ccty",whntr500.ccty)
stpapi.put.field("tfacp1120s000","amount",str$(whntr500.amnt))
stpapi.put.field("tfacp1120s000","tfgld102.dbcr",str$(whntr500.dbcr))
stpapi.put.field("tfacp1120s000","tfgld102.vamt",str$(whntr500.vamnt))
stpapi.put.field("tfacp1120s000","tfgld102.ddue",whntr500.leac)
if check.dim1() then
stpapi.put.field("tfacp1120s000","tfgld102.dim1",whntr500.dim1)
stpapi.put.field("tfacp1120s000","tfgld102.dim2",whntr500.dim2)
endif
stpapi.put.field("tfacp1120s000","tfgld102.dim3",whntr500.dim3)
stpapi.put.field("tfacp1120s000","tfgld102.dim4",whntr500.dim4)
retval = stpapi.insert("tfacp1120s000",0,err.msg)
if retval <> 1 then
return(false)
endif
return(true)
}