date - LotusScript Function Doesn't Update Field -



date - LotusScript Function Doesn't Update Field -

i'm trying document created each instance of string of dates.

this doesn't work i'd hoped - field doesn't update , debugger doesn't show me @ all.

can point me in right direction code?

public sub co_multidates() 'basic error handler function 'on error goto errorhandler 'errorhandler: msgbox("error " & cstr(err) & ": " & error$ & " on line " & cstr(erl)) 'everything below designed populate field populates column multiple date values 'this designed when creating location record multiple days, there multiple entries in employee's view dim w new notesuiworkspace dim multistartdate notesdatetime dim multienddate notesdatetime dim tempdate notesdatetime dim datearray() notesdatetime dim datecounter integer dim adjustday integer dim source notesuidocument set source = w.currentdocument dim thisdoc notesdocument set thisdoc = source.document ' populate multistartdate , multienddate values startdate , enddate fields set multistartdate = new notesdatetime(thisdoc.getitemvalue("startdate")(0)) set multienddate = new notesdatetime(thisdoc.getitemvalue("enddate")(0)) 'assign null value datecounter - calculates difference between startdate , enddate allow datecounter = 0 while multistartdate.timedifference(multienddate) <= 0 'add multidates redim preserve datearray(0 datecounter) set tempdate = new notesdatetime(multistartdate.dateonly) set datearray(datecounter) = tempdate 'add 1 date loop phone call multistartdate.adjustday(1) datecounter = datecounter + 1 wend 'replaces value of multidatesarray field in newdoc (current document) value of datearray phone call thisdoc.replaceitemvalue("multidates", datearray) 'updates audit trail field changes phone call setaudittrail(w.currentdocument.document, "audittrailfield", 1, "personname", "person name") end sub

i sense missing obvious.

thanks.

based on fact using ui classes , updating document, i'm assuming running code in notes client document open in edit mode, tested in context adding above sub code form fields startdate, enddate , multidates , called click event of button on form. added every date between startdate , enddate field multidates, seems intended purpose is.

if want create document each date in range, need add together code within while loop that, such as:

' in declarations... dim session notessession dim thisdatabase notesdatabase set thisdatabase=session.currentdatabase ' in loop... set newdoc=thisdatabase.createdocument newdoc.form="childform" ' or whatever newdoc.mydate=datearray(datecounter) ' other stuff document, then... phone call newdoc.save(false, true)

if of above assumptions off, edit question more details context , improve answer.

function date lotus-notes lotusscript

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -