Hi!
I have a view categorized by room number. The first user to reserve a room becomes first in the list and it stays there for 7 days (until due date) or until the user has confirmed the room reservation. Those who reserve the same room after him becomes part of the wait list.
I need to get the number of days each person has to wait for until they are first in the list. Much like project scheduling.
sample lotus script is very much appreciated.
code snippet:
I am so stumped with this one. Please help.
Thanks so much and God bless!
Tine
I have a view categorized by room number. The first user to reserve a room becomes first in the list and it stays there for 7 days (until due date) or until the user has confirmed the room reservation. Those who reserve the same room after him becomes part of the wait list.
I need to get the number of days each person has to wait for until they are first in the list. Much like project scheduling.
sample lotus script is very much appreciated.
code snippet:
Code:
Set dview = db.GetView("($AllDocsView)")
dkey = uidoc.FieldGetText("RefCode")
Set ddc = dview.GetAllDocumentsByKey(dkey)
Set ddoc = ddc.GetFirstDocument
nwait = 0
Do While Not (ddoc Is Nothing)
Set bkDate = New NotesDateTime( Today)
Set startDate = New NotesDateTime( ddoc.dueDate(0) )
duration = Abs(startDate.TimeDifference(bkDate)/86400) - 1
dDate = duration + 7 + nwait
nwait = nwait + duration
Loop
I am so stumped with this one. Please help.
Thanks so much and God bless!
Tine