ap2203
7th August 2008, 22:46
I try write AFS for tfgld4410m000, but I can not do it. I put field ocom, tror, fitr, trdt and on the second form field index.
Whatewer i do i can do it corrert because when I put field trdt and I control from debug field is correct and when I start session I get data which I dont set in field.
Can anyone help me
Where I make a mistake
Thanks
mark_h
8th August 2008, 14:42
Post you code for tfgld4410m000 and we might see the problem.
ap2203
11th August 2008, 15:58
Post you code for tfgld4410m000 and we might see the problem.
Here is my code:
trdtfroms=date.to.inputstr$(trdtfrom,"%D002,3",8)
trdttos =date.to.inputstr$(trdtto,"%D002,3",8)
stpapi.put.field("tfgld4410m000","ocom.f","000")
stpapi.put.field("tfgld4410m000","ocom.t","999")
stpapi.put.field("tfgld4410m000","tror.f",str$(etol(tctror.prd)))
stpapi.put.field("tfgld4410m000","tror.t",str$(etol(tctror.prd)))
stpapi.put.field("tfgld4410m000","fitr.f",str$(etol(tcfitr.transfer)))
stpapi.put.field("tfgld4410m000","fitr.t",str$(etol(tcfitr.transfer)))
stpapi.put.field("tfgld4410m000","trdt.f",trdtfromx)
stpapi.put.field("tfgld4410m000","trdt.t",trdttox)
stpapi.put.field("tfgld4410m000","screen.ccur","HRK")
|stpapi.put.field("tfgld4410m000","fyer.f",str$(year.ff))
|stpapi.put.field("tfgld4410m000","fyer.t",str$(year.tt))
|stpapi.put.field("tfgld4410m000","fprd.f",str$(prod.ff))
|stpapi.put.field("tfgld4410m000","fprd.t",str$(prod.tt))
stpapi.put.field("tfgld4410m000","auto.index",str$(etol(tcyesno.yes)))
stpapi.put.field("tfgld4410m000","index.choice","1")
i=stpapi.find("tfgld4410m000")
stpapi.set.report("tfgld4410m000","rtfgld441012000",printer1,err.msg)
stpapi.continue.process("tfgld4410m000",err.cont)
stpapi.end.session("tfgld4410m000")
last.mess.sess.tfgld4410=stpapi.get.mess.code(sess.tfgld4410)
stpapi.end.session("tfgld4410m000")
Whatever I put in the field tror.f and fitr.f program begins with tctror.pur and
tcfitr.receipt, but I dont wont that
Can you help me what is not correct
Thanks for help
mark_h
11th August 2008, 16:18
Elminate the stpapi.find - not necessary. See if that works.
ap2203
11th August 2008, 16:45
I try, but it doesnt work.
Nothing happend
Any new idea
mark_h
11th August 2008, 18:11
No new ideas, but tomorrow when I get a chance I will test the code on our test system. I do not see anything that should reset those two fields.
mark_h
12th August 2008, 15:15
Okay this worked for me:
domain tcdate somedate
somedate = date.num()
stpapi.put.field("tfgld4410m000","ocom.f","701")
stpapi.put.field("tfgld4410m000","ocom.t","701")
stpapi.put.field("tfgld4410m000","tror.f",str$(etol(tctror.prd)))
stpapi.put.field("tfgld4410m000","tror.t",str$(etol(tctror.prd)))
stpapi.put.field("tfgld4410m000","fitr.f",str$(etol(tcfitr.p.mat.isu.hrd.a)))
stpapi.put.field("tfgld4410m000","fitr.t",str$(etol(tcfitr.p.mat.isu.hrd.a)))
stpapi.put.field("tfgld4410m000","trdt.f",str$(somedate - 30))
stpapi.put.field("tfgld4410m000","trdt.t",str$(somedate))
stpapi.set.report("tfgld4410m000", "rtfgld441012000","D66", err)
stpapi.continue.process("tfgld4410m000",err)
err = stpapi.get.mess.code("tfgld4410m000")
mess(err,1)
stpapi.end.session("tfgld4410m000")
Note you need to move the stpapi.get.mess.code to right before you end the session. Make sure you are not getting any messages. In my case I put only the fields I needed.
ap2203
12th August 2008, 23:39
Okay this worked for me:
domain tcdate somedate
somedate = date.num()
stpapi.put.field("tfgld4410m000","ocom.f","701")
stpapi.put.field("tfgld4410m000","ocom.t","701")
stpapi.put.field("tfgld4410m000","tror.f",str$(etol(tctror.prd)))
stpapi.put.field("tfgld4410m000","tror.t",str$(etol(tctror.prd)))
stpapi.put.field("tfgld4410m000","fitr.f",str$(etol(tcfitr.p.mat.isu.hrd.a)))
stpapi.put.field("tfgld4410m000","fitr.t",str$(etol(tcfitr.p.mat.isu.hrd.a)))
stpapi.put.field("tfgld4410m000","trdt.f",str$(somedate - 30))
stpapi.put.field("tfgld4410m000","trdt.t",str$(somedate))
stpapi.set.report("tfgld4410m000", "rtfgld441012000","D66", err)
stpapi.continue.process("tfgld4410m000",err)
err = stpapi.get.mess.code("tfgld4410m000")
mess(err,1)
stpapi.end.session("tfgld4410m000")
Note you need to move the stpapi.get.mess.code to right before you end the session. Make sure you are not getting any messages. In my case I put only the fields I needed.
I'll try do identical as you write and I expect success (at then begining write code I also write only fileds I need but doesnt work, after that I put another fields from form1 and also from form2, but without effects )
Thanks for help
mark_h
13th August 2008, 04:38
It could be as simple as needing library update or a session update. Have you contacted support? Do you have the source code for tfgld4410m000? If you do you could put it in debug mode and see what is happening.
ap2203
28th August 2008, 18:05
I'll try do identical as you write and I expect success (at then begining write code I also write only fileds I need but doesnt work, after that I put another fields from form1 and also from form2, but without effects )
Thanks for help
Now it work
Thanks