Page 1 of 1

Display Error Message in TI validation

Posted: Fri Oct 26, 2012 9:39 am
by conflax
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

Re: Display Error Message in TI validation

Posted: Fri Oct 26, 2012 10:02 am
by declanr
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
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.

Re: Display Error Message in TI validation

Posted: Fri Oct 26, 2012 12:07 pm
by conflax
Interesting idea - thanks.

Re: Display Error Message in TI validation

Posted: Fri Oct 26, 2012 10:33 pm
by paulsimon
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

Re: Display Error Message in TI validation

Posted: Sat Oct 27, 2012 12:30 pm
by Harvey
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.

Re: Display Error Message in TI validation

Posted: Fri Nov 02, 2012 6:10 am
by rmackenzie
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.
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.

Re: Display Error Message in TI validation

Posted: Thu Nov 08, 2012 11:11 pm
by KathyW
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.

Re: Display Error Message in TI validation

Posted: Thu Nov 08, 2012 11:14 pm
by rmackenzie
KathyW 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.
Try here

Re: Display Error Message in TI validation

Posted: Thu Nov 08, 2012 11:35 pm
by KathyW
rmackenzie wrote:
KathyW 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.
Try here
Oops! I should have found that myself! Thank you.