Examples: Named element formulas
- The following formulas are for a named element representing the content of a frame. The frame contains a form named "Form A" if the current user is a manager in the current database and a page named "Page X" otherwise. In both cases, the named element is in the database "Test New Features.nsf."
The "Formula for kind of named element" box contains:
@If(@Contains(@DbManager; @UserName); "Form"; "Page")
The "Formula for database" box contains:
"Test New Features.nsf"
The "Formula for name of named element" contains:
@If(@Contains(@DbManager; @UserName); "Form A"; "Page X")
- This example, when triggered from a hotspot button, either links to a page called "Web Customer Info," if the current user is a Web user, or to a form called "Customer Info" otherwise.
In the "Formula for kind of named element" box, enter:
@If(@Contains(@UserName;"Anonymous");"Page";"Form")
In the "Formula for database" box, enter "Customer.nsf."
In the "Formula for name of named element" box, enter:
@If(@Contains(@UserName;"Anonymous");"Web Customer Info";"Customer Info")
- This example shows how to use a database on the same server and in the same subdirectory as the current server, but with the filename "customers.nsf." This formula is useful when creating a set of databases that function as a group. The databases can be copied into a different subdirectory to create an occurrence of the set of databases for (say) a different department.
server := @DbName[1];
mypath := @Dbname[2];
mydir := @RightBack(mypath; "\\");
@If(server = ""; ""; server + "!!")
+ @If(mydir = ""; ""; mydir + "\") + "customers.nsf"