wilsonphilips
29th September 2005, 02:21
Hi Everybody.

Excuseme if I'm not the most expert in AFS, but I want use this tools in order to make some interfases between Baan and Lotus Notes.

I know that Lotus Notes accept WV scripts.

I made a VB script for testing but I don't know how AFS function with the normal validation of a Baan Sesion.

For example if I want insert a Purchase order and I trie to insert a bad supplier code, the normal sesion give me a window with an error (Supplier Code doesnt exists´). In AFS i can't see the same, I put and incorrect code and the system doesn't show anything.

Can someone give me an advice.

Thanks


Wilson.

Paul P
29th September 2005, 06:33
Wilson, AFS does have error handling commands as said in the manual. Following are example how it can be implemented in your code. For more information on AFS error handling, consult the manual (get the latest one)
function create.run.number(domain whinh.oorg order.origin)
{
if prev.proc.ok then
select whinh400.runn:dummy.str
where whinh400._index1={:whinh915.swti}
selectempty
stpapi.synchronize.dialog("whinh4500m000","add",err.mesg)

stpapi.put.field("whinh4100s000","whinh400.runn",whinh915.swti)
stpapi.put.field("whinh4100s000","whinh400.kofr",str$(etol(whinh.kofr.outbound)))
stpapi.insert("whinh4500m000",true,err.mesg)
if not isspace(err.mesg) then
while true
stpapi.get.mess.code("whinh4100s000",err.mesg)
if isspace(err.mesg) then break endif
err.mesg="4100 Ins: "&err.mesg
print.err.rprt()
endwhile
prev.proc.ok=false
stpapi.recover("whinh4100s000",err.mesg)
if not isspace(err.mesg) then
while true
stpapi.get.mess.code("whinh4100s000",err.mesg)
if isspace(err.mesg) then break endif
err.mesg="4100 Recover: "&err.mesg
print.err.rprt()
endwhile
endif
endif
stpapi.end.session("whinh4100s000")
stpapi.end.session("whinh4500m000")
endselect
endif
}
Rgds,
Paul

mark_h
29th September 2005, 15:53
You can also search this forum for examples of VB code to see how others do this - one recent thread (http://www.baanboard.com/baanboard/showthread.php?t=25088).