看看@username的帮助,有两种方法可以实现你的需求:
1. 用私有视图,但是比较麻烦的是,如果视图有什么改动,刷新设计比较麻烦,而且如果视图是存在服务器上的,私有视图多了难免会对性能造成一定的影响。
2. 用嵌入视图来实现。把视图嵌入到page或者form中,在嵌入的时候有一个选项是:Show Single Category,你做一个视图,第一列是From,排序,然后在form 或者page的show single category里面写上@username即可。
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.