i trying use formula open document within field when comes validation. have set database checks duplicate entries , want database (if form created) check doesn't exist , if ask user if wants open form. have got set , acquired unid when come save document test (with working perfectly) gives following error
@commands , other ui functions not allowed in context not sure try. appreciate. command used follows
@command([editdocument];1;unid) //where unid id have acquired
task, cannot done formula language. message sais: @commands cannot used in of contexts task.
you need use lotusscript in matching event (e.g. querysave) check , open other document. here example code:
%include "lsconst.lss" sub querysave( source notesuidocument, continue variant ) dim ses new notessession dim db notesdatabase dim ws new notesuiworkspace dim doc notesdocument dim ok variant dim strotherunid string set db = ses.currentdatabase strotherunid = source.document.otherunid(0) if strotherunid <> "" continue = false ok = messagebox ("there document, want edit it?" , mb_yesno + mb_iconquestion, "question" ) if ok = idyes set doc = db.getdocumentbyunid( strotherunid ) call ws.editdocument( false, doc ) end if end if end sub this code not tested @ all, used starting point. needs field called "otherunid" contains universalid of other document.
Comments
Post a Comment