Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] tMsgBox type question, error when clic on cancel button

Hi,
I'm using tMsgBox (button Question : Ok, Cancel) on TOS v5.0.1 and I would like to test the user's choice (which button was used).
My job is composed by 3 tMsgBox, one for the user's choice and 2 for testing choice (RunIf condition : ((String)globalMap.get("tMsgBox_1_RESULT")).equals("0") and !((String)globalMap.get("tMsgBox_1_RESULT")).equals("0"))

When I'm click on the cancel button, I have this error :
connecting to socket on port 3971
connected
Exception in component tMsgBox_1
java.lang.NullPointerException
at repli_kdi_mysql_vm.tests_msgbox_0_1.tests_msgbox.tMsgBox_1Process(tests_msgbox.java:299)
at repli_kdi_mysql_vm.tests_msgbox_0_1.tests_msgbox.runJobInTOS(tests_msgbox.java:679)
at repli_kdi_mysql_vm.tests_msgbox_0_1.tests_msgbox.main(tests_msgbox.java:550)
disconnected
See my screenshot for details.
Thank's in advance.
Regards
Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,
Thanks for your reply.
I'm using this condition : Relational.ISNULL(((String)globalMap.get("tMsgBox_1_RESULT")))
Regards

View solution in original post

2 Replies
Anonymous
Not applicable
Author

Hi,
Since you click cancel the result will be no object. Therefor your if conditions run into error because ((String)globalMap.get("tMsgBox_1_RESULT")) is no object.
You could use "0".equals(((String)globalMap.get("tMsgBox_1_RESULT"))) and !"0".equals(((String)globalMap.get("tMsgBox_1_RESULT"))) instead.
Regards,
Arno
Anonymous
Not applicable
Author

Hi,
Thanks for your reply.
I'm using this condition : Relational.ISNULL(((String)globalMap.get("tMsgBox_1_RESULT")))
Regards