What I want is RCA documents, no responses (versioning is turned on, hence the last part of the formula), and all ones in Initial or Assigned Status, none where the cause is ‘Timing’, ‘Duplicate’ or ‘Connection Failure’, and all the ones closed in the past week.
Here’s the relevant part of the code to mark an RCA closed:
Set uidoc = uiws.CurrentDocument
Set doc = uidoc.Document
Dim dateTime As New NotesDateTime("")
Call dateTime.SetNow
doc.Status = "Closed"
doc.DateClosed = dateTime.DateOnly
I swear this was working until recently… although the DateClosed field is a time/date one in the design, it’s showing as Text in doc properties. It’s too late to change that (at least I think it is) as this has been in production for quite a while.
Can anyone please help me fix this?.. TIA if you can!!
Subject: View selection problem in time-based view
I spot two problems. First, the one you asked about – the DateOnly property returns a STRING. This ensures that you will be saving text into your DateClosed field. Remember field settings on the form are irrelevant if you are using a back-end document (not UIDoc). You could add a compute-with-form to force form and field properties to be enforced. Alternately, you can populate that field with a time-date value.
A more serious looking problem is that you are using @Today in your view selection formula. That will be OK if you only have a few hundred documents in the database. Otherwise your users will be in for very long waits every time they open that view – especially as the database grows. Search this forum for time based views. Probably you will want to simply categorize the view by week and remove the reference to today.
Subject: RE: View selection problem in time-based view
Thanks ever so much Doug. I think I’ll have to do a little field change to the currently closed docs, to change them back to time/date ones, and then change the script so that the DateClosed field is just set to “Today” - I think that’ll work a lot better.