When a formula runs on a server, the agent signer is considered the current user. Using @UserName on a local database or in a private view in a server-based database returns the user's name. You should not use @UserName in a public view, doing so produces unpredictable results. Also, if the field that you are referencing changes, you will get unpredictable results because the index has to be rebuilt to accommodate the new information.
One use for @UserName is to display only those documents relevant to the current user. For example, your Service Request database could use @UserName in the private view named Assignments to display each technician's assignments, weeding out everyone else's:
SELECT @UserName=AssignedTo
However, the user can still design a different private view that retrieves all documents, so don't depend on @UserName as a security mechanism.
For an alternative way to display only documents relevant to the current user, see "To show a single category in an embedded view."
If you are using Release 5 and have an alternate name as well as a primary name, it is best to store the alternate name in the document as author information when using the extended feature of @UserName.