Dupl.occur is possible but ....
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)
if api.mode then
And in the specific program
stpapi.application.option(ARTPCS, 1, 9, error)
if error <> "" then
retsave = stpapi.save(ARTPCS,error)
if retsave = 0 then
message.erreur = "Pb sauvegarde Article :"
retour = 7