ServerSandboxExists

This function tests for the existence of the passed sandbox. 1 is returned when the passed sandbox exists, 0 otherwise.

This is a TM1® TurboIntegrator function, valid only in TurboIntegrator processes.

Syntax

ServerSandboxExists( sandboxname ) 

or

ServerSandboxExists( sandboxname , username )

Arguments

The name of the sandbox whose existence is being tested. ServerSandboxExists takes an optional string parameter, the owning client's name. The calling client can use the optional parameter to specify a client other than themselves if the calling client has the appropriate privileges. A privilege error will result if the specified client is not the executing client and the executing client is not a member of the DataAdmin or ADMIN groups. If the optional parameter is not used, the active client's sandboxes are the subject.

Example

The following snippet shows how the ServerSandboxExists, ServerSandboxGet, and ServerSandboxListCountGet functions can be used to iterate the sandboxes of user called User1 and output those sandboxes to a text file. The TurboIntegrator process would successfully execute for members of the Admin or Data Admin groups and for user called User1. The TurboIntegrator process would fail with a privilege error for any other users.

SandboxIndex = 1;
NumSandboxes = ServerSandboxListCountGet( 'User1' );

WHILE( SandboxIndex <= NumSandboxes );

   SandboxName = ServerSandboxGet( SandboxIndex, 'User1' );

   IF( ServerSandboxExists( SandboxName, 'User1' ) = 1 );

      ASCIIOUTPUT( 'C:\User1Sandboxes.txt', SandboxName );

   ENDIF;

   SandboxIndex = SandboxIndex + 1;

END;