Xpages submit : save conflict

i’ve an xpages with some field and a submit button…i open the xpages from another button. in the data of xpages the IDDocument is computed :

var idDoc;

IDDOC = facesContext.getExternalContext().getRequest().getParameter(“IDDOC”);

return IDDOC;

when opens and save the first it’s ok but, when opens and save another time it creates a replicate or save conflict document.

thanks