What I've probably longed most for in pages is the ability to have global variables. I thought this was impossible due to the lack of fields in a page.
It turns out it's quite simple. The reason I came up with trying this is Andre Guirards article on Using View Column Programmatic Names. In this article (recommended read!), he discusses the usage of FIELD in view columns/selection formulas to create temporary global variables.
To declare a variable as global, put FIELD in front of it.
FIELD globalVariable := "I'm global!";
For cross client (Notes/Web) pages, it seems that you have to put the global variable declarations in "Window Title". First declare your variables using FIELD, then add the code for the window title.Declaration:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh63_xj8_FRMJSU-e0P2JjTjzBRGkphF0C9tCf7edGHPARPnrEfFKco_k79iGU_C2mVcNHFDlxY2Chb4Mo6IE9vh1FazVFIP55rERqf8Nr-iWM-YK4Hws5BXJB8hnmwdFIQlH6trNclaGV3/s400/ScreenShot001.png)
Using the variable in a computed text:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtus0iD1gZCLa7oDx0HWSdk5t2M4nkzHGjzePQxOxfNF0Mg4AcLc63wREsxm0DTiHNmF0A4BhZmy7JIgYVVoNULBlo6k1jIvIutBnzu9KmIpZzX660OsW-RTESOqCJXWeYj_O8fWH4d8ww/s400/ScreenShot002.png)
Notes:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSlKaZ5098PrbqB-BHFLCbPUurAjORSOlROV-_IJCDLFD94evS2QmhwVRO_rAz4drhiHv3cdQ4naI2Y3B0a3ugAURLtjGTv-bmZMnB6iYYGy-HUDTs4YaGcb6a0fKLeOtlOgcgU6IHFMLw/s400/ScreenShot003.png)
Web:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2YBrTOg-Ec6kp9cAti76Vjzi7V9ZsQSXHskD6ona_ZWDs3TYa-wIDpqQbrlmAx8EOLK0JMYUAuHyaT8UTg8YanY-OH-8Uu2wadDjCjWhPOW-AozjU_C5sfI2T_K4qFrG7qlP3UhwBK5Yd/s400/ScreenShot004.png)
3 comments:
Very good find! I don't know when, but, I suspect I will be using that one at some point in the future.
Thanks
No problem.. :)
This is probably most useful when you want to use the result of a dblookup/dbcolumn multiple places, or have global constants (replicaid/db path/etc.).
At least that was what I planned using it for.
Thanks a lot... this saved me a lot of coding as well as waiting time to ReCache dbcolumns for every computed field... Thanks
Post a Comment