View Single Post
  #3  
Old 13th January 2003, 18:16
Guillaume.G's Avatar
Guillaume.G Guillaume.G is offline
Member
 
Join Date: Aug 2002
Location: Lyon - France
Posts: 69
Guillaume.G is on a distinguished road
Baan: Triton3.1, BaanIV,baan ERP and ERP Ln - Workflow - DB: Oracle(7 to 10i), SQLserver(6.5 to 2005), Bisam - OS: NT,2000, 2003, Unix(Solaris,AIX,HPUX)- Linux
Dupl.occur is possible but ....

Hi mark_h,

I try your solution, but it's not work
because the field of the screen is not in the API field buffer so the fields are empty (==> Error message )
Your idea is correct if you make a stpapi.get.field for all field of all form of the session
and for the copy you make a put field of all field (with modify value) and finish with an insert.
But the very big problem is the code of the choice.dupl.occur of the session is NOT executed !!!!

So i find an another solution which it's possible only if you have the program script std. and with stpapi.application.option.

the solution is :
you create a user.9 option in the std script (tipcs2121)
choice.user.9
on.choice
if api.mode then
execute(dupl.occur)
endif

And in the specific program
stpapi.put.field(ARTPCS,"tipcs021.cprj",itm.cprj)
stpapi.put.field(ARTPCS,"tipcs021.item",itm.item)
stpapi.put.field(ARTPCS,"tipcs021.dsca",itm.dsca)
stpapi.application.option(ARTPCS, 1, 9, error)
if error <> "" then
retsave = stpapi.save(ARTPCS,error)
if retsave = 0 then
stpapi.recover(ARTPCS,err.recover)
message.erreur = "Pb sauvegarde Article :"
& strip$(error)
send.mess(message.erreur,"----")
retour = 7
endif
endif
stpapi.end.session(ARTPCS)


Best Regard

Guillaume.G
Reply With Quote