janmeesters
9th December 2011, 16:20
Hi

Using afs to insert batches, everything works fine only tfacr200.dim1 is not inserted in the database. Afs doesn't give any errors

I tried completing the record and an update


<tfacr1110s000 0 no view found
>tfacr1110s000(109) put.field:tfacr200.ninv 21103702
>tfacr1110s000(109) put.field:tfacr200.itbp REL101376
>tfacr1110s000(109) put.field:tfacr200.pfbp REL101376
>tfacr1110s000(109) put.field:tfacr200.docd 734477
>tfacr1110s000(109) put.field:screen.amnt 1806.72
>tfacr1110s000(109) put.field:tfacr200.lvat 2
>tfacr1110s000(109) put.field:tfacr200.vaty 2011
>tfacr1110s000(109) put.field:tfacr200.vatp 11
>tfacr1110s000(109) put.field:tfacr200.refr 11/00187 Stg. Het Barlake - lo
>tfacr1110s000 insert
103dll->serv (add.set+save^A109)
tfacr1110s000(109)-RUNNING:add.set+save
109serv<-4gl (add.set+save^A0^A1)
tfacr1110s000(109)-RUNNING:
<tfacr1110s000
>tfacr1110s000(109) put.field:tfacr200.dim1 21020
>tfacr1110s000 save

But the update isn't correct, other fields i tested are all updated.

Any clues anyone ????

This is ( a part ) of the source


ret = stpapi.synchronize.dialog("tfacr1110s000","add",ret.mess)
| now process the line
|stpapi.put.field("tfacr1110s000","tfacr200.ttyp",str$(save.ttyp))
stpapi.put.field("tfacr1110s000","tfacr200.ninv",str$(save.ninv))
stpapi.put.field("tfacr1110s000","tfacr200.itbp",save.cuno)
stpapi.put.field("tfacr1110s000","tfacr200.pfbp",save.cuno)
stpapi.put.field("tfacr1110s000","tfacr200.docd",str$(save.dcdt))
stpapi.put.field("tfacr1110s000","screen.amnt",str$(save.amnt))
stpapi.put.field("tfacr1110s000","tfacr200.lvat","2")
stpapi.put.field("tfacr1110s000","tfacr200.vaty",str$(save.fyer))
stpapi.put.field("tfacr1110s000","tfacr200.vatp",str$(save.fprd))
stpapi.put.field("tfacr1110s000","tfacr200.refr",save.desc)
ret = stpapi.insert("tfacr1110s000",true,ret.mess)
if ret = 0 then
message("tfacr1110s000 - fout in sessie : [%1s]",ret.mess)
ret = stpapi.recover("tfacr1110s000",ret.mess)
error = 1
else
stpapi.save("tfacr1110s000",ret.mess)
ret = stpapi.change.view("tfacr1110s000",ret.mess)
stpapi.put.field("tfacr1110s000","tfacr200.dim1",str$(save.dim1))
stpapi.update("tfacr1110s000",true,ret.mess)
stpapi.save("tfacr1110s000",ret.mess)

mark_h
12th December 2011, 00:17
Why aren't you setting the dim1 field before the insert? What happens if you try that? I know sometimes there is code that gets activated after you set a field that undoes what you put. I know one session, I think purchase order headers that would not update one certain field. I just put a select/update in to update the header before activating the lines. That solved my problem.

Having said that I am not that familiar with the session and will look to see if I have one for it tomorrow.