Article
· Feb 29 1m read

How to register global mapping programmatically

InterSystems FAQ rubric

Global mappings can be registered using the system class Config.MapGlobals.

The method to globally map ^Sample.PersonD in a database SAMPLES other than the default database from the namespace USER is as follows (example executed in a terminal).

USER>zn "%SYS" 

%SYS>set ns="USER" 

%SYS>set glo="Sample.PersonD"
 
%SYS>set vals("Database")="SAMPLES"
 
%SYS>set st=##class (Config.MapGlobals).Create(ns,glo,.vals)

The third argument of the Create() method of the Config.MapGlobals class is passed by reference, so specify it by appending a period (.) to the variable name.

In addition to using the Config.MapGlobals class, you can also define using the installation manifest class.

Please refer to the attachment for details on how to create an installation manifest class.

The following example is an example definition in the installation manifest (class definition is included in the attachment).

XData  Test [  XMLNamespace  = INSTALLER ]
{
< Manifest >
< Namespace  Create = "no"  Name = "USER"  Code = "USER"  Data = "USER" >
< Configuration >
< GlobalMapping  Global = "Sample.PersonD"  From = "SAMPLES " />
</ Configuration >
</ Namespace >
</ Manifest >
}

Please also refer to our documentation for more information.

About the installation manifest [IRIS]
About the installation manifest 

Discussion (0)1
Log in or sign up to continue