Pandora - Sample - Obtain System Variable

From SmartWiki
Revision as of 14:28, 5 August 2010 by Cameron (talk | contribs) (Created page with ' The following code will obtain the value from the System Variable called '''Registration Deadline''' var rs= session_getuser(false,"","firstname"); USERID=rs.getfieldbyna…')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The following code will obtain the value from the System Variable called Registration Deadline

var rs= session_getuser(false,"","firstname");
USERID=rs.getfieldbyname(1,"userid");
rs=variables_replace(false,"",40,USERID,"@system.Registration Deadline@");
var msg=rs.getfieldbyname(1,"msg");
alert("The Registration Deadline is " + msg);

Notes

  • The first 2 lines obtain your user ID, in case it is relevant to the variables_replace search (ie: if the variable is a user variable)
  • The variables_replace function always returns the result in a field named msg