ItemReject TM1 Function: Syntax and Use

Sometimes we want to put some text directly into the TM1 Message log to record why something is occurring in a TM1 Turbo Integrator process. This function will place the current record into the TM1 message log along side a custom message.

ItemReject Syntax

The syntax is simply ItemReject(ErrorString); where ErrorString is the message you want put in the TM1 Message log along side the record.

Example and Usage of ItemReject

We use it to record an outcome in the message log. For example we have a process that deletes all data from a target cube. There are parameters set up called pCube and pCheck – to capture the cube name to be cleared and to check if TM1 has been backed up before the clear process is run. We then use ProcessQuit to stop the TI midstream.

The code on Prolog is then:

## WARNING - THIS PROCESS COMPLETELY DELETES ALL DATA FROM THE TARGET CUBE ###

### Check if TM1 has backed up and that the cube to be completely cleared exists before continuing

IF (pCheck @= 'Y' % pCheck @='Yes');

IF ( CubeExists ( pCube) = 0);

vErrorMessage = 'The cube entered does not exist';

ItemReject ( vErrorMessage );

ProcessQuit;

ELSE;

CubeClearData ( pCube);

ENDIF;

ELSE;

vErrorMessage = 'User has indicated that the backup has not been completed';

ItemReject ( vErrorMessage );

ProcessQuit;

ENDIF;

So this process will check if TM1 has been backed up, then check if the target cube exists, then clear the data from it. If either TM1 has not been backed up or the cube does not exist, it record in the Message Log the reason why the process has quit.

ItemReject is a TM1 TurboIntegrator function, valid only in TurboIntegrator processes.

 

If you like this post, please spread the love…

About John

Managing Director of Infocube. We are a management accounting consultancy that specialises in Business Analytics.
This entry was posted in TI Functions and tagged message log. Bookmark the permalink.

One Response to "ItemReject TM1 Function: Syntax and Use"

Log in to post a comment.