Hey Experts, Below I've posted a script I'm using on a view action that will allow the user to select a User and a job, it then modifies the view select formula to reflect the users picks, this is working fine, I need to enhance the script by allowing the user to also pick a date range and getting that into the Select formula: i.e. User selects John, then selects job 123 next should be a prompt for a begin date, then an end date with the end date defaulting to today. Once he has selected this the Select formula should reflect accordingly. Select Form = FormName & User ="John" & JobNumber = "123" & @Adjust (@Date (TimeinDate); 0; 0; -???; 0; 0; 0) = @Date (@Today);
The ??? should reflect the difference in the dates they have selected.....This is probably clear as mud but it's a start...
Modified Script: Allows for selection of Professional and Job Number:
Sub Click(Source As Button)
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
Dim ws As New NotesUIWorkspace
Dim UserDbColumn As Variant
Dim JobDbColumn As Variant
UserDbColumn = Evaluate(|@Trim(@Unique(@DbColumn("";"":"";"(TimeByJobSel)";1)))|)
GetValue = ws.Prompt(4, "Professional", "Select Professional", "",UserDbColumn)
If GetValue = "" Then
Messagebox "Operation Canceled" ,,"No Professional Selected."
JobDbColumn = Evaluate(|@Trim(@Unique(@DbColumn("";"":"";"(TimeByJobSel)";2)))|)
GetValue1 = ws.Prompt(4, "Client Matter", "Select Job", "",JobDbColumn)
If GetValue1 = "" Then
Messagebox "Operation Canceled" ,,"No Job Selected."
Dim NewFormula As String
NewFormula = |SELECT Form = "Timeslip" & From="|& GetValue & |" & JobNumber= "|& GetValue1 & |" |
Set uiview = ws.CurrentView
Set view = uiview.View
view.SelectionFormula = NewFormula