patotools
23rd May 2019, 23:24
We have Baan IV c4 SP 32.

We are using AFS to do deliveries session tdsls4120m000.

For some item we deliver using the pick list (Index2) so we changed the indexes in the session so the default index is 2 - Pick List. But for Cost Items we need to use Index1 - Sales Order and position.

I found the command stpapi.sort.by:

ret.code = stpapi.sort.by("tdsls4120m000", "1", mensaje.error)

But ret.code returns value 0.

Has anybody use this command. Or how have you solved the problem.

Regards

Patricio

mark_h
27th May 2019, 03:50
Never new that command existed. But just testing stpapi.sort.by on tppdm0101m000 I do not get an error and the return code is 0. In your example you are changing to the default order by of 1. Do you mean to try something else? I change the item master to 3 and then I put purchased and the item - it seems to work but not sure.

younes74
28th June 2019, 22:59
use this 2 command to get what you need

long session.id
session.zoomindex = 2
session.id = start.synchronized.child( "your session name" ,"index field" , "value","index field" , "value","index field" , "value","index field" , "value")

Note :
session.zoomindex is a global variable you do not need to declare it.
session.id is type long hold the session ID

Next time you want to call the session again you just need to call
synchronize.with.child(session.id)

Oh before for end your program kill all the session child. This a clean programing
choice.end.program:
before.choice:
stop.synchronized.children()
choice.abort.program:
before.choice:
stop.synchronized.children()


function stop.synchronized.children()
{
if session.id then
dummy.return = stop.synchronized.child(session.id)
endif
}
I hope this would help