I am fairly new to Domino Designer and am requesting your help.
I have a form with several fields. I am having trouble with 2 of my fields.
Field 1 - Is titled “OnlyWarehouse”. This is a radio button with “Yes” and “No” as the options.
Field 2 - Is titled “LastEditedOn”. This field is a computed field.
In field “LastEditedOn” I would like to capture the date anytime field “OnlyWarehouse” is changed.
I have tried several @functions without any luck and I am not familiar with LotusScript at all. I can capture when the entire form is edited, but wish to capture the date when a specific field is updated. Can anyone help me figure this out?
Subject: Capture last edit date when a specifc field is edited
LotusScript is really the only way to fly here. Formula Language can be used, but it involves adding extra fields to the form and can be “confused” by refreshes.
Go to the Declarations section of the Globals object on the form (in the objects/references pane immediately to the left of the Programmer’s Pane in Designer) and create a global variable to hold the value of the OnlyWarehouse field:
Dim oldOnlyWarehouse As String
Then, in the PostOpen event, go to Initialize section and edit it to look like this:
Finally, in the QuerySave event’s Initialize section, you would add something like this to check the value and add to the LastEditedOn field if necessary:
Sub Initialize(Source As NotesUIDocument, Continue As Variant)
If Not (Source.FieldGetText(“OnlyWarehouse”) = oldOnlyWarehouse) Then
Source.FieldSetText(“LastEditedOn”, Cstr(Now))
End If
End Sub
When you use this sort of technique, LastEditedOn should be computed to itself (that is, the formula should just be the fieldname), otherwise it will try to compute to something other than what the LS is setting it to.
Between ‘OnlyWarehouse’ and ‘LastEditedOn’ add a computed-for-display field, ‘TestField’, with this formula:@if(@IsDocBeingLoaded;OnlyWarehouse;@ThisValue);