From: Phil Whyte
Category: Category 1
Date: 19 Apr 1998
Time: 12:31:44
Remote Name: iscl.demon.co.uk
I need to have a way of making a document ready only except for the originator (author). For example, Fred Flintstone create a document. Only Fred can edit it and change the original data once it has been saved. If Wilma tries to edit it it either a) will not go into edit mode, or b) issue an error message stating she cannot edit or save changes.
I have coded a tacky solution based on a computed field containing the original @UserName and using @Prompt to issue an error message. The formula is: VAL := @Name([CN];From); @If (@IsNewDoc; VAL; @If (From != @UserName & @IsDocBeingSaved; @Do( @Prompt([OK]; "Error"; "You are not allowed to save changes in this Document. Please exit again and choose No to save changes. An error will follow.") ; @Command( [EditDocument] ) ) ; VAL))
This doesn't let the user save the document (as required) and issues my nice message first. However, to stop the save it issues a failure & error message for the @Command( [EditDocument] ) which isn't so good.
Any ideas/pointers appreciated.
[_private/nddisc_aftr.htm]