Andy..
14th September 2007, 11:03
Hi, found a strange problem using confirm picklist. It seems sometimes when you select a record using api find it marks the next pick sequence line (eg select line 25 and it goes to line 30). The same behaviour is exhibited when running the session in Baan and clicking 'find'. So we coded around this where if it finds the wrong/next record it goes to the previous line using:

stpapi.browse.set( "whinh2525m100", "prev.set" )

this USUALLY works, but sometimes even the prev.set command still gets stuck at the 'next' line. We have run this in debug and checked the prev line is there in the std session and valid and it all checks out fine, but the prev.set still doesnt go to the previous pick sequence. I'd say this is working about 70% of the time at the moment and cannot work out why. It seems more likely to fail with a pick sequence line ending in '5'!

Any suggestions as to
a. why find selects the next line in the session
b. why the workaround of moving to the previous line is not working reliably

Thanks!

mark_h
15th September 2007, 21:58
It could be the code or the indexes. Are you putting all the fields needed for the find? For example if you are finding order, but the find asks for order and operation, then put the order and the operation. The operation could be 0.

Andy..
18th September 2007, 11:19
thanks for the reply Mark. There is only one extra field when you search, but that is always blank. Doesnt explain why it most often works, but sometimes fails though :confused: I have now tried setting it within the api to "" and will see if that helps.

Cheers, Andy

Andy..
20th September 2007, 10:45
Here is the extract from afs.log that shows the find is returning the next record and that the prev.set still returns the SAME record :confused:

whinh2525m100(34)-RUNNING:
>whinh2525m100(34) put.field:whinh225.btno OUT
>whinh2525m100(34) put.field:whinh225.cwar FIN
>whinh2525m100(34) put.field:whinh225.picm 113
>whinh2525m100(34) put.field:whinh225.lseq 35
>whinh2525m100(34) put.field:whinh225.loca
>whinh2525m100 Find
9dll->serv (def.find34)
whinh2525m100(34)-RUNNING:def.find
34serv<-4gl (def.find00)
whinh2525m100(34)-RUNNING:
<whinh2525m100 an other record found (2)
>whinh2525m100 get.field:whinh225.lseq
<whinh2525m100(34) get.field:whinh225.lseq=45
>whinh2525m100 browse.set
9dll->serv (prev.set34)
whinh2525m100(34)-RUNNING:prev.set
34serv<-4gl (prev.set0)
whinh2525m100(34)-RUNNING:
<whinh2525m100 1 ok
>whinh2525m100 get.field:whinh225.picm
<whinh2525m100(34) get.field:whinh225.picm=113
>whinh2525m100 get.field:whinh225.lseq
<whinh2525m100(34) get.field:whinh225.lseq=45

in this example we are trying to find seq 35, but it gets stuck on 45. If you go into the session 35 is there. How can this be?!

mark_h
20th September 2007, 15:52
Are all your objects current? Including the session object. I did have one session where the prev.set and next.set would not work by making the record current, but the find always worked. Do you have source code to where you might be able to debug what is happening?

cte sistemas
7th October 2010, 18:16
Hello Gurus:

Someone solves the problem reported before?

Now I'm doing an afs using this session ans have the same problem that was reported.

Some one can help me?


thanks

mark_h
7th October 2010, 19:22
Have you tried using the find versus the prev.set?