Normal Topic GlobalValue (Read 547 times)
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
GlobalValue
Aug 23rd, 2006 at 2:55pm
Print Post Print Post  
I'm still trying to wrap my head around GlobalValue and @GlobalValue.  I think I've come up with a use for it/them, but I'm uncertain how to go about it.  Here's my current situation:

In my workorder form, one of the elements is named Creator, and this fills in each time a new form is opened.  Here's the code I'm using:
Code
Select All
// Sets the Creator of the Workorder

IF (@ISNEW AND @ISBLANK(CREATOR))
THEN CREATOR = @USERID

IF CREATOR = "SCOTT" THEN CREATOR = "SL"
ELSE IF CREATOR = "ROD" THEN CREATOR = "RM"
ELSE IF CREATOR = "JOE" THEN CREATOR = "JR"
ELSE IF CREATOR = "JOHN" THEN CREATOR = "JM"
ELSE IF CREATOR = "DAVE" THEN CREATOR = "DL"
ELSE IF CREATOR = "CHRIS" THEN CREATOR = "CC"
ELSE IF CREATOR = "DOUG" THEN CREATOR = "DS"
ELSE IF CREATOR = "MICHELLE" THEN CREATOR = "MT"
ELSE IF CREATOR = "JASON" THEN CREATOR = "JJ" 



The user opens the form, the programming fills in the Creator field with his UserID, and then changes that to his initials.

So I'd like to fill the Global Values with the name and initials, and then grab the results as necessary.  But 1) I'm not sure where I input the Global Values and 2) I'm not sure how I'd retreive them and pop them into Creator.  As for step 2, I think I'd need a statement like
Code
Select All
Creator = @GlobalValue(@UserID) 

but that's just a guess.

Someone please prod me in the right direction, thanks.
  

**
Captain Infinity
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: GlobalValue
Reply #1 - Aug 23rd, 2006 at 3:15pm
Print Post Print Post  
Hello Scott,

Step One: Run a Mass Update that will fill in the Global Values ex:
Code
Select All
GlobalValue("SCOTT", "SL")
GlobalValue("ROD", "RM")
GlobalValue("JOE", "JR")
GlobalValue("JOHN", "JM")
GlobalValue("DAVE", "DL")
GlobalValue("CHRIS", "CC")
GlobalValue("DOUG", "DS")
GlobalValue("MICHELLE", "MT")
GlobalValue("JASON", "JJ") 



You only need to run this Mass Update once.

As for Step 2. That code looks right. Just don't forget the
Code
Select All
IF (@ISNEW AND @ISBLANK(CREATOR)) 

Statement.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: GlobalValue
Reply #2 - Aug 23rd, 2006 at 3:29pm
Print Post Print Post  
Quote:
Step One: Run a Mass Update that will fill in the Global Values ex:

Ah, I see.  Global Values are set in the .db.  Somehow I had it in my head that these values were programmed into the .dsr.  I knew I could see them and delete them in the Global Values List Manager, but I couldn't figure out how to set them up.

Thanks Ray!  That worked great!
  

**
Captain Infinity
Back to top
IP Logged