cancel
Showing results for 
Search instead for 
Did you mean: 

Can I have variable data in a global variable?

Former Member
0 Kudos

Hi all,

I would like to have a global variable to use for formatting log entries. It would be something like this which is from an

assignment action: datenow & tab & "APPNAME: "

Is it possible?

--Thanks

--Amy Smith

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Look for a system variable that can return the appname.

Chanti.

Former Member
0 Kudos

Thanks, It is the current date/time I wanted. Does that work, picking up the current date/time whenever the global variable is referenced?

--Amy

Former Member
0 Kudos

It should. "datenow" is a function that returns current date/time.

Why would you want to reference it as a global variable when it is already available in the link editor?

Edited by: CKxMII on Jan 27, 2010 5:03 PM

Former Member
0 Kudos

Here is what I get in the log. It looks like it takes the global variables as constants.

I defined logPrefix as this: datenow & tab & IllumLoginName & tab & "APEX" & tab

Write Action Block writes this:

Globals.logPrefix & "Confirm and Pack: Failed with Confirm message:" & Create_Time_Ticket.LastErrorMessage & crlf

And got this in the log:

datenow & tab & IllumLoginName & tab & "APEX" & tabConfirm and Pack: Failed with Confirm message:

It looks like it takes the global variables as constants. I was hoping there was some coding like {} or ## that would allow variables.

Why? To have a fixed prefix for every log record written without having to remember what it is and type it all in correctly for EVERY log record.

--Amy Smith

--Haworth

Former Member
0 Kudos

My point is -

Define logPrefix as this: IllumLoginName & tab & "APEX" & tab

Write Action Block writes this:

datenow & tab & Globals.logPrefix & "Confirm and Pack: Failed with Confirm message:" & Create_Time_Ticket.LastErrorMessage & crlf

Former Member
0 Kudos

I DID

IllumLoginName doesn't get translated.

Seems what you are implying is that it will be translated if it is in the first position of the global. Is that what you mean?

Thanks for your help. I would like to know from someone who has done this and had it work or knows that it doesn't work.

--Amy Smith

--Haworth

Former Member
0 Kudos

Is IllumLoginName a system defined function or variable???

Former Member
0 Kudos

Check this thread, similar to what you are looking for. They are not using globals though.

Former Member
0 Kudos

Amy,

the global variable is a fixed value you can use in all BLTs but which is not interpreted.

To have a "global" log prefix, I guess a small helper BLT should work which you can call and which returns the prefix you want.

The IllumLoginName is only available in your BLT if the Autobind is on like Chanti described and if the BLT is called from a Xacute query from the web.

Hope this helps.

Michael

Former Member
0 Kudos

Thanks Michael,

--Amy Smith

--Haworth

Answers (0)