cherokee
13th July 2005, 22:35
I do not know what is wrong with this code but, it does not find any record and I can't see a problem on it. I'll appreciate if anyone can have a look at it and give an input.

Thanks in advance

Carlos


stpapi.put.field("tssma1104m000","tssma104.cins",tssma104.cins)
stpapi.put.field("tssma1104m000","tssma104.pono",str$(tssma104.pono))
if stpapi.find("tssma1104m000") then
stpapi.put.field("tssma1104m000", "tssma104.cser", tssma104.cser)
stpapi.update("tssma1104m000", true, o.error )
if not isspace(o.error) then
stpapi.recover( "tssma1104m000", t.error )
stpapi.end.session("tssma1104m000")
return(false)
endif
else
stpapi.end.session("tssma1104m000")
return(false)
endif
stpapi.end.session("tssma1104m000")
return(true)

mark_h
14th July 2005, 15:35
Have you tried stpapi.clear before putting fields? If the find does not work is it at least finding any record? See what returns with a stpapi.get on some fields. Do you own source or a wrapper program?

cherokee
14th July 2005, 18:06
stpapi.clear... I do not have that function within the AFS documentation I got. :rolleyes:

Could you please give the syntax? or I do not know if my api lib suppor this stpapi.clear...

Carlos

NPRao
14th July 2005, 20:05
Carlos,

You can use the search option the board to find that info.

Here is the syntax-

Clear All fields
SYNTAX
void stpapi.clear(string session)
ARGUMENTS
Session Name of the session this command is executed on.
DESCRIPTION
This function fills in an ‘empty’ value (unset) for all input fields of the form.
EXAMPLE
stpapi.clear(“dtfsa1101s000”)
stpapi.put.field("dtfsa1101s000", "dtfsa101.seno", str$(i.seno)) stpapi.put.field("dtfsa1101s000",
"dtfsa101.name", name)
retval1 = stpapi.insert("dtfsa1101s000", true, error.msg)
if not retval1 then
retval2 = stpapi.recover("dtfsa1101s000", recover.msg)
endif
Explanation:
Before you execute the put.field actions, you first make all fields empty using
the clear function.
USAGE NOTES
Function in dll created by creatdll:
Function extern void <fs-name>.clear()
Note
In early versions of Functionserver, you required this stpapi.clear function to
clear the put field buffers. The newer versions will after an action such as
insert automatically reset the put field buffers.

cherokee
14th July 2005, 20:51
I have tried all your sugestions and this and still not working...

I can get the values from the fields I put only but, after the stpapi.find() fails, not values in any other field.

Any other Ideas.

Thanks again.

Carlos

cherokee
15th July 2005, 17:36
Found the problem.

withinthe session tssma1104m000 there are two variables(zoom.cins and zoom.pono).

tssma1104m000 session:

zoom.from.other:
on.entry:
import("zoom.cins",zoom.cins)
import("zoom.pono",zoom.pono)


So, before I call the FS, I set up these two variables in my calling program and it works.

I did not know that FS call sessions as a zooming session.


Thanks and hope this help to someone else.

Carlos :p