Hi all,
Does anyone know a way of displaying an on-screen error message when validating parameters in TI?
I have a process which takes Year/Month/Ledger parameters into a data load, and I am using ITEMREJECT to validate the user input.
This writes a message to the logfile but i'd like to be able to display this to the user on the screen, similar to VBA's MsgBox function.
IF(DIMIX('Month',pPeriod)=0);
ITEMREJECT('Invalid Month');
"Invalid month" is written to the log file but not the screen
Any ideas how I can do this please?
Thanks
Steve
Display Error Message in TI validation
-
- MVP
- Posts: 1831
- Joined: Mon Dec 05, 2011 11:51 am
- OLAP Product: Cognos TM1
- Version: PA2.0 and most of the old ones
- Excel Version: All of em
- Location: Manchester, United Kingdom
- Contact:
Re: Display Error Message in TI validation
If you are running it as an action button in a spreadsheet or websheet you could add a CellPutS ( 'ControlCube', .......) before your item reject and have that appear in the sheet somewhere.conflax wrote:Hi all,
Does anyone know a way of displaying an on-screen error message when validating parameters in TI?
I have a process which takes Year/Month/Ledger parameters into a data load, and I am using ITEMREJECT to validate the user input.
This writes a message to the logfile but i'd like to be able to display this to the user on the screen, similar to VBA's MsgBox function.
IF(DIMIX('Month',pPeriod)=0);
ITEMREJECT('Invalid Month');
"Invalid month" is written to the log file but not the screen
Any ideas how I can do this please?
Thanks
Steve
Declan Rodger
-
- Posts: 47
- Joined: Thu Jun 07, 2012 10:20 am
- OLAP Product: TM1
- Version: Various
- Excel Version: Various
- Location: UK
Re: Display Error Message in TI validation
Interesting idea - thanks.
- paulsimon
- MVP
- Posts: 808
- Joined: Sat Sep 03, 2011 11:10 pm
- OLAP Product: TM1
- Version: PA 2.0.5
- Excel Version: 2016
- Contact:
Re: Display Error Message in TI validation
As a slightly more complex variation on the previous theme, I would have to check the exact details but I think that the scheme I used was along the lines of this... A master process executes the sub process that actually does the work. The sub process writes the details of its TM1ProcessError log file to a cube which uses the }Clients dimension to have a different slot for each user. It uses TM1User() to get the name of the user running the process. The master process checks that the sub process exited properly. If the return code is not ProcessExitNormal it gets the name of the TM1ProcessError file that the sub process stored in a cube. It then reads this into another cube again split by user. There is a limit of eg the first 100 lines.
The errors are then shown below on the sheet.
The scheme mentioned before is good for one line rejects in the Prolog, but the one mentioned above will also let users get a better idea of what happened with any failures on the MetaData or Data tabs.
By the way if you use
IF( validation check fails ) ;
ItemReject( ... ) ;
ENDIF ;
and your process has a MetaData or Data tab, you should change it to
IF( validation check fails ) ;
vError = 1 ;
ItemReject( ... ) ;
ENDIF ;
and then put the following at the top of the MetaData and Data tab.
IF( vError = 1 ) ;
ProcessQuit ;
ENDIF ;
Regards
Paul Simon
The errors are then shown below on the sheet.
The scheme mentioned before is good for one line rejects in the Prolog, but the one mentioned above will also let users get a better idea of what happened with any failures on the MetaData or Data tabs.
By the way if you use
IF( validation check fails ) ;
ItemReject( ... ) ;
ENDIF ;
and your process has a MetaData or Data tab, you should change it to
IF( validation check fails ) ;
vError = 1 ;
ItemReject( ... ) ;
ENDIF ;
and then put the following at the top of the MetaData and Data tab.
IF( vError = 1 ) ;
ProcessQuit ;
ENDIF ;
Regards
Paul Simon
- Harvey
- Community Contributor
- Posts: 236
- Joined: Mon Aug 04, 2008 4:43 am
- OLAP Product: PA, TM1, CX, Palo
- Version: TM1 8.3 onwards
- Excel Version: 2003 onwards
- Contact:
Re: Display Error Message in TI validation
The Flow Responder application can send an email detailing a TI error, but since it's plug-in based architecture, it can take any action that can be performed by a computer.
It's just beta software at the moment, but if you're interested to test it out, let me know.
It's just beta software at the moment, but if you're interested to test it out, let me know.
Take your TM1 experience to the next level - TM1Innovators.net
-
- MVP
- Posts: 733
- Joined: Wed May 14, 2008 11:06 pm
Re: Display Error Message in TI validation
One better is that you can point the button to that cell in the 'Options' dialog in the button properties when you select 'Run a Turbo Integrator Process'. The default text is either 'Process completed successfully' or 'Process failed' but you can put a formula in there instead of text. Like '=A1' for example which could be a DBR(W) pointing to your control cube where the error is stored. For that matter, you can actually write the =DBR("Control Cube", ... directly into the dialog and the action button will evaluate the function and return the message to the user in the way you expect re MsgBox. It's possible to build up some quite complex contextual feedback UI doing this (start thinking about having }Clients in a 'feedback' cube)... but the downside is that you get a bit of TI bloat because of the additional processes and code that need to work out user input, validate it, and then give the feedback.declanr wrote:If you are running it as an action button in a spreadsheet or websheet you could add a CellPutS ( 'ControlCube', .......) before your item reject and have that appear in the sheet somewhere.
Robin Mackenzie
-
- Posts: 3
- Joined: Wed Sep 07, 2011 8:47 pm
- OLAP Product: TM1
- Version: 9.4.1
- Excel Version: 2007
Re: Display Error Message in TI validation
I have a question regarding "The sub process writes the details of its TM1ProcessError log file to a cube". How does the process know the name of the process error log file? I haven't been able to find anything that would tell me this. Thanks.
-
- MVP
- Posts: 733
- Joined: Wed May 14, 2008 11:06 pm
Re: Display Error Message in TI validation
Try hereKathyW wrote:How does the process know the name of the process error log file? I haven't been able to find anything that would tell me this.
Robin Mackenzie
-
- Posts: 3
- Joined: Wed Sep 07, 2011 8:47 pm
- OLAP Product: TM1
- Version: 9.4.1
- Excel Version: 2007
Re: Display Error Message in TI validation
Oops! I should have found that myself! Thank you.rmackenzie wrote:Try hereKathyW wrote:How does the process know the name of the process error log file? I haven't been able to find anything that would tell me this.