rduncan10
15th January 2008, 21:20
Hi,
I'm trying to write some AFS code to load financial budgets in the session tffbs1101m000, in Baan 4 c4.
The code here runs without any errors, but when it gets to the end, there is no record inserted. Any idea why?
stpapi.put.field("tffbs1101m000", "tffbs101.year", str$(year.i))
stpapi.put.field("tffbs1101m000", "tffbs101.budg", str$(budg.i))
stpapi.put.field("tffbs1101m000", "tffbs101.dim1", str$(dim1.i))
stpapi.put.field("tffbs1101m000", "tffbs101.dim2", str$(dim2.i))
stpapi.put.field("tffbs1101m000", "tffbs101.dim3", str$(dim3.i))
stpapi.put.field("tffbs1101m000", "tffbs101.dbcr", str$(dbcr.i))
stpapi.put.field("tffbs1101m000", "tffbs101.disb", "")
stpapi.put.field("tffbs1101m000", "year.amnt", str$(0))
ret = stpapi.change.view("tffbs1101m000", err)
for x = 1 to 12
| Amounts stored in an array.
stpapi.put.field("tffbs1101m000", "tffbs101.prod", str$(x))
stpapi.put.field("tffbs1101m000", "tffbs101.amnt", str$(per.amnt(x)))
ret = stpapi.update("tffbs1101m000", 1, err)
if ret = 0 then
stpapi.recover("tffbs1101m000", err)
else
| I've tried it with and without this line below.
ret = stpapi.save("tffbs1101m000", err)
endif
endfor
stpapi.end.session("tffbs1101m000")
Thanks,
Rob
I'm trying to write some AFS code to load financial budgets in the session tffbs1101m000, in Baan 4 c4.
The code here runs without any errors, but when it gets to the end, there is no record inserted. Any idea why?
stpapi.put.field("tffbs1101m000", "tffbs101.year", str$(year.i))
stpapi.put.field("tffbs1101m000", "tffbs101.budg", str$(budg.i))
stpapi.put.field("tffbs1101m000", "tffbs101.dim1", str$(dim1.i))
stpapi.put.field("tffbs1101m000", "tffbs101.dim2", str$(dim2.i))
stpapi.put.field("tffbs1101m000", "tffbs101.dim3", str$(dim3.i))
stpapi.put.field("tffbs1101m000", "tffbs101.dbcr", str$(dbcr.i))
stpapi.put.field("tffbs1101m000", "tffbs101.disb", "")
stpapi.put.field("tffbs1101m000", "year.amnt", str$(0))
ret = stpapi.change.view("tffbs1101m000", err)
for x = 1 to 12
| Amounts stored in an array.
stpapi.put.field("tffbs1101m000", "tffbs101.prod", str$(x))
stpapi.put.field("tffbs1101m000", "tffbs101.amnt", str$(per.amnt(x)))
ret = stpapi.update("tffbs1101m000", 1, err)
if ret = 0 then
stpapi.recover("tffbs1101m000", err)
else
| I've tried it with and without this line below.
ret = stpapi.save("tffbs1101m000", err)
endif
endfor
stpapi.end.session("tffbs1101m000")
Thanks,
Rob