Difference between revisions of "Pandora - Sample - Obtain System Variable"
From SmartWiki
Line 1: | Line 1: | ||
The following code will obtain the value from the [[System Variable]] called '''Registration Deadline''' | The following code will obtain the value from the [[System Variable]] called '''Registration Deadline''' | ||
− | var rs= | + | |
− | + | var rs=variables_replace(false,"",40,"@me.userid@","@system.Registration Deadline@"); | |
− | |||
var msg=rs.getfieldbyname(1,"msg"); | var msg=rs.getfieldbyname(1,"msg"); | ||
alert("The Registration Deadline is " + msg); | alert("The Registration Deadline is " + msg); | ||
==Notes== | ==Notes== | ||
− | * | + | * For system variables it doesn't matter what object you process them against. In this case the current user account is used. |
* The '''variables_replace''' function returns the result in recordset in a field named '''msg''' | * The '''variables_replace''' function returns the result in recordset in a field named '''msg''' | ||
Revision as of 10:12, 21 February 2012
The following code will obtain the value from the System Variable called Registration Deadline
var rs=variables_replace(false,"",40,"@me.userid@","@system.Registration Deadline@"); var msg=rs.getfieldbyname(1,"msg"); alert("The Registration Deadline is " + msg);
Notes
- For system variables it doesn't matter what object you process them against. In this case the current user account is used.
- The variables_replace function returns the result in recordset in a field named msg