depp_baan
13th February 2002, 14:17
Does anybody have experience in updating records in Baan 5.0c using stpapi.

We try to update general items using the sessions tcibd0501m000 and tcibd0101s000.

The following example of the "Developer's Guide for Application Function Server" does not work. We are not able to run the stpapi.find with success. It returns 1, but has found a wrong record.
-----------------------------------------------------------------------------------
stpapi.put.field("dtfsa1501m000", "dtfsa101.seno", str$(i.seno)
ret = stpapi.find("dtfsa1501m000", error.msg)
if ret = 1 then
ret = stpapi.synchronize.dialog("dtfsa1501m000", "modify", error.msg)
if ret then
stpapi.put.field("dtfsa1101s000", "dtfsa101.name", new.name)
ret = stpapi.update("dtfsa1501m000", true, error.msg)
if not ret then
ret = stpapi.recover("dtfsa1101s000", error.msg)
endif
endif
stpapi.end.session("dtfsa1501m000", error.msg)
-----------------------------------------------------------------------------------

We have 5.0c with SP6.

Thank you for your help.

Smiffy
13th February 2002, 15:44
I didn't think Baan V had STPAPI functions. Am I wrong ???

Han Brinkman
13th February 2002, 16:00
It's available for sure. I now of a few customers which are on Baan5.0[bc] who are using it.

popeye
13th February 2002, 19:36
Hi Deep,
I have been facing the same problem for a while now.
Although the find() function was returning a value of 1, the
record was not being picked up correctly.
I tried the following options.
Instead of checking the return value, I did the following.

xxx.put.OrderNumber(hold.orno)
xxx.find()
tmp.orno = get.OrderNumber()
if tmp.orno = hold.orno then
Record found ... process 'em
else
Record not found
endif

Downside ... It used to go to the else part even if the record
did exist.

Upside ... Atleast I am not processing the wrong record :)

I am still looking for a solution.
Lemme know if you find a solution.

baan_spain
20th March 2002, 16:25
I've documented this problem for my own database

VERSION(S):

BaanERP 5.0b, 5.0c

SITUATION IDENTIFIED IN:

Function server call.

ATTACHMENTS:

na

SITUATION DESCRIPTION:

Segmented items do not work with function server calls.

SOLUTION DESCRIPTION:

For segmented items you need to specify the item.segment.# section.


EXAMPLE(S):

whinh2120s000f.put.whinh220.item(ircv7110.item)

must become:
whinh2120s000f.put.whinh220.item.segment.2(ircv7110.item)
for the second item part.

WORK-AROUND

na


Hope it helps.

depp_baan
25th March 2002, 09:57
Thank you all for your comments. Special thanks to baan_spain, you solved our problem.

The problem was related to the segement problem. We had to reference the item field in that way: item.segment.2