I wanted to ask for some advice- I have a database that contains authors and editors- They would like to have the one of the forms locked after 180 days of the creation date but still allow the editors to be able to edit documents if needed. I thought the QueryModeChange event would be the place to do this. Would it be better to use LotusScript or Formula language to accomplish this? Maybe this is not the best way to do it? I have been going back and forth trying to figure this out.
thanks
Sue
Subject: querymodechange event
How about just an agent to run daily/weekly/whatever, to delete/clear the authors fields on the appropriate forms 180 days after creation? Editors would still be able to edit because they are editors. Authors wouldn’t be able to because they wouldn’t be in the authors field anymore. (You’ll just have to make sure the authors field isn’t computed, but computed when composed would work.)
Subject: Computed Subforms / “Must have at least Editor access…”
I would recommend using a computed subform for the content that should remain editable following the 180 day lock; set the formula to display one subform if @Created is more than 180 days in the past (using @Adjust) and another if not.
On the subform that will display once the document is locked, in each editable field’s properties enable the security option (third tab) "Must have at least Editor access to use). Leave this option deselected on the other subform.
Taking this approach will allow both Authors and Editors to edit the content for the first 180 days, but only Editors from then on. Hope this helps…
Subject: RE: Computed Subforms / “Must have at least Editor access…”
Tim
Thanks for your suggestion- I did have a few questions though- I already have documents created with this form what would be the easist way to incorporate that into those documents- Also I am new to this and am somewhat confused on the formula to hide the subform. I have a computed when composed field on the form who’s value is @Created. To display the subform after 180 days - Would it be something like CreateDate(field on the form) > @Adjust(CreateDate;0;0;-180;0;0;0)? I really appreciate your help with this.
Sue
Subject: querymodechange event
Querymodechange is not a good way to do this – it’s not a security feature. There are too many ways for a user who technically has access to edit a document (based on the database ACL and Authors fields in the documents), to bypass your Querymodechange code and make changes to it anyway.
As just one example, any user can create a Smarticon to change field values from a view, as described here. There’s no event you can code to intercept this.
If you don’t want an Author level user to be able to edit a document, write a server agent to locate those documents you want to lock, and clear their Authors fields.
If you want to keep the original author’s name in there as a record of who created the document, use a regular Names field for that, and make the Authors field hidden.