richen
8th July 2004, 16:11
I have problems with updating records. I have made a session which updates table tipcs025 from session tipcs2110m000 which has 3 (multi-occ+view + main) form

this is what i have done :confused:

stpapi.put.field("tipcs2111m000","tipcs025.cprj",str$(tipcs025.cprj))
stpapi.put.field("tipcs2111m000","tipcs025.pano",str$(tipcs025.pano))
ret = stpapi.find("tipcs2111m000",error.msg)

ret = stpapi.browse.set("tipcs2111m000","first.set",error.msg)
while ret
stpapi.get.field("tipcs2111m000","tipcs025.cprj",tmpprj)
stpapi.get.field("tipcs2111m000","tipcs025.pano",tmpprjdeel)
if tipcs025.cprj = tmpprj and tipcs025.pano = tmpprjdeel then
stpapi.put.field("tipcs2111m000","tipcs025.vcsl.c","600")
|Note 600 is a test value
ret = stpapi.update("tipcs2111m000",true, error.msg)
endif
ret = stpapi.browse.set("tipcs2111m000","next.set",error.msg)
endwhile
rprt_send()
stpapi.end.session("tipcs2111m000")

After the update de values of field tipcs025.vcsl.c stays zero :mad:

mark_h
8th July 2004, 20:36
Below is what I would expect to work:


|* Only if there are two key fields on your version
stpapi.put.field("tipcs2111m000","tipcs025.cprj",str$(tipcs025.cprj))
stpapi.put.field("tipcs2111m000","tipcs025.pano",str$(tipcs025.pano))
ret = stpapi.find("tipcs2111m000",error.msg)
if return = 1 then
| Found project and
stpapi.put.field("tipcs2111m000","tipcs025.vcsl.c","600")
ret = stpapi.update("tipcs2111m000",true, error.msg)
endif
rprt_send()
stpapi.end.session("tipcs2111m000")


If this does not work then you may want to try a save before and after the update. Just a couple of things you can check.

Mark

richen
13th July 2004, 14:23
Mark,

It works :)

Thanx