Siebel Object Interfaces Reference > Interfaces Reference > Application Methods >

SetSharedGlobal Method


Shared global variables are unique to the user and the user's associated session. One user's global variables are not visible to other users. The variables are global to the current user and session only. The SetSharedGlobal property sets a shared user-defined global variable, which may be accessed using GetSharedGlobal.

Syntax

Application.SetSharedGlobal(varName, value)

Argument
Description

varName

String variable or literal containing the name of the shared global variable to set

value

String variable or literal containing the value to set the variable to set

Returns

Not applicable

Used With

COM Data Control, COM Data Server, Mobile/Dedicated Web Client Automation Server, Server Script

Example

The following example is for COM. SiebelApplication is an Application instance.

comVar = SiebelApplication.GetSharedGlobal("myVar", errCode)
SiebelApplication.SetSharedGlobal "myVar", "BLAH", errCode

The following example is in Siebel VB.

TheApplication.SetSharedGlobal "myVar", "FOO"
myVar = TheApplication.GetSharedGlobal("myVar")

In this example, the SetSharedGlobal method is called to set a global variable called myGlobalVar in Application_Start event. The global variable can be accessed from any event. For this example, in the BusComp_WriteRecord event, the GetSharedGlobal method is called to retrieve the global variable.

The following example is for COM. SiebelApplication is an Application instance.

Dim sReturn as String
oleVar = SiebelApplication.GetSharedGlobal("myGlobalVar", errCode)
SiebelApplication.SetSharedGlobal "myGlobalVar", " helloworld", errCode

The following example is in Siebel eScript.

function Application_Start (CommandLine)
{
   TheApplication().SetSharedGlobal("myGlobalVar", "helloworld");
}

function BusComp_WriteRecord ()
{
   var myVar;
   myVar = TheApplication().GetSharedGlobal("myGlobalVar");
}

The following example is in Siebel VB.

Sub Application_Start (CommandLine As String)
   TheApplication.SetSharedGlobal "myGlobalVar", "helloworld"
End Sub

Sub BusComp_WriteRecord
   Dim myVar as String
   myVar = TheApplication.GetSharedGlobal("myGlobalVar")
End Sub

See Also

GetLastErrCode Method

Siebel Object Interfaces Reference