Submitted by markfoley on 2009/06/12 20:46
 Is there any way to set a variable globally, which could be referenced in auto assign rules, code, etc?  Eg myname = "Mark Foley".  I couldn't see one about.
 
The use I'm thinking of would be to be able to have a little box with the globals you want in it, and you could for example put your  'attendees' in the text box and it would use that value to put in certain fields, etc rather than editing it deep in the dialogs.  Those boxes could float in a little window, or be part of the toolbars.
 
Inheritance gets you around this to some extent I think (thats how I do it now) but it would be a good one to consider for keeping out of the advanced UI when doing simple things.
 
Cheers

Comments

Not exactly as you say, but functionaly the same:
 
Create a VBScript Function:
 
Function Global(varName)
dim v
select case varName
case "var1": v=myGlobalValue1
case "var2": v=myGlobalValue2
end select
Global=v
end function
 
You can then reference your global variables. e.g.:
 
MyField=Global("var1") * myField2
 
[edit] This function can be in the User or Database section of the VBScript editor, depending on your requirements. You can even have both, simply give the functions a different name
 
 

markfoley

2009/06/13 11:30

In reply to by Pierre_Admin

Clever!  A good approach that does the trick I think. 
 
Down the track being able to create a textbox or similar in toolbars and access their value via code would be cool too.
 
Thanks for that Pierre!