infatuated01
26th February 2018, 05:21
Hi,

I unable to use AFS "stpapi.zoom.option" command .Everytime i try this command it always end up with "Error: Unresolved reference to function 'stpapi.zoom.option'." but the other command are working fine such as stpapi.put.field , stpapi.find etc.Can you guys help with this issues ?

P.S. I aleady declared "#pragma used dll ottstpapihand "

P.S.2 I am using baan 10.5

Regards

andreas.toepper
26th February 2018, 08:25
I do have an AFS development guide of 2011. It is saying that stpapi.zoom.option is for use with BaanIV only.

"Execute session zoom option
Syntax
void stpapi.zoom.option(string session, long form, string zoom.prog, ref string err.mesg)
(..)
Usage Notes
This function is for ERP Baan IV only. For ERP Baan 5.x and ERP Enterprise (LN), use stpapi.form.command()."

Maybe it's simply missing in the LN 10.5 implemented AFS functions and needs to be replaced by stpapi.form.command()?

Infor Integration 6.2
Developer's Guide for Application Function Server
Publication date: October 4, 2011
Document code: U8627B US

infatuated01
27th February 2018, 13:33
Thank for a reply !

I changed stpapi.zoom.option to stpapi.form.command and it worked but i faced the other problem .The problem is the value which AFS gave me didn't exist in session I am zooming.

Here's my code :

stpapi.put.field(OUTBOUND.ADVICE, "whinh225.oorg", str$(whinh200.oorg))
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.orno", str$(whinh200.orno))
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.oset", str$(whinh200.oset))

|order line
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.pono", str$(whinh220.pono))
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.seqn", str$(whinh220.seqn))

|advice
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.sern", str$(advice))

long retval
stpapi.handle.subproc(OUTBOUND.ADVICE, "whinr1540m000", "add")
stpapi.form.command(OUTBOUND.ADVICE,2,"whinr1540m000",error.msg)
if isspace(error.msg) then
stpapi.put.field("whinr1540m000", "whinr140.loca", str$(whinr140.loca))
if (isspace(whinr140.clot)) then
message("empty lot")
else
message("has lot" & str$(whinr140.clot))
stpapi.put.field("whinr1540m000", "whinr140.clot", str$(whinr140.clot))
endif
stpapi.put.field("whinr1540m000", "whinr140.idat", str$(whinr140.idat))
retval = stpapi.find("whinr1540m000",error.msg)
retval = stpapi.mark("whinr1540m000",error.msg)
if isspace(error.msg) then
|stpapi.continue.process("whinr1540m000",error.msg)
stpapi.form.command( "whinr1540m000", 5, "exec.cont.process", error.msg )
else
message(error.msg)
endif

else
message(error.msg)
endif
stpapi.end.session("whinr1540m000")
else
message(error.msg)
endif

|to location
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.loct", "LOD007")

|advice quantity
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.qads", str$(advised.quantity))
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.quni", str$(whinh220.orun))

ret = stpapi.insert(OUTBOUND.ADVICE, true, error.msg)


The value that AFS should return

whinr140.loca : A1101
whinr140.clot : L20170830-001
whinr140.item : 321-DVA
whinr140.idat : 30/08/2017 01:00:00 pm


The value AFS gave me is wrong

whinr140.loca : A1101
whinr140.clot : 00060317-001
whinr140.item : 321-DV
whinr140.idat : 06/03/2017 11:09:11 am


P.S. I attached the photo of session that I use and session I am zooming

Do you have any suggestion for this ?


Best Regards,

andreas.toepper
27th February 2018, 15:45
What's the value of retval?
retval = stpapi.find("whinr1540m000",error.msg)

"Return Values
0 No record found: Empty table or error occurred and err.mesg is filled.
1 Record found: err.mesg is empty.
2 A record different from the one requested was found: err.mesg is empty."

Ajesh
6th April 2018, 05:37
Before using stpapi.find, you should set all the primary keys using stpapi.put.field, atleast as much as possible, otherwise it will give you unpredictable results. This is what i have experienced first hand.