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] tsendmail give error arguments from job in message field

Hello erverybody,
How i can give tsendmail the error message with which comes from my Job when an error occurs into the message Field.
Are there any preconfigured args ?
regards john 
Labels (2)
16 Replies
Anonymous
Not applicable
Author

Hello you two,
@Arnaud:
Your code works perfect.  Thanks for that
Does any Table exist with some preconfigured Arguments which is mentioned in your code Solution?  
@Sabrina:
Your code doesn't work in my environment ... may I'm doing it wrong.
I have tried two ways:
1. "Here is the error Message:  ((String)globalMap.get ("tLogCatcher_1_ERROR_MESSAGE"))"|
2."Here is the error Message:  ((String)globalMap.get ("tLogCatcher_1_ERROR_MESSAGE"))"
There comes an error :
1. 
0683p000009MCXm.png2. 
0683p000009MCXr.png
 regards john 
Anonymous
Not applicable
Author

Hi,
Please try this solution to see if it works
"The exception is:"+((String)globalMap.get("tLogCatcher_1_ERROR_MESSAGE"))

Best regards
Sabrina
Anonymous
Not applicable
Author

Hi,
Or you can use a tLogCatcher to capture  the exception and put it to a global variable or context variable for use later, and then send an email whenever an exception occurs.
For example:
tLogCatcher--main--tJavaRow
    |
onsubjobok
    |
tSendMail
on tJavaRow:
globalMap.put("errorMessage", input_row.message);
in the message field of tSendMail, get the exception message like:
"The exception is: "+((String)globalMap.get("errorMessage"))
Best regards
Sabrina
Anonymous
Not applicable
Author

Hi,
Does any Table exist with some preconfigured Arguments which is mentioned in your code Solution?  

All arguments come from tLogCatcher component (see schema). But no table exist with some preconfigured arguments to put in your message.
Arnaud
Anonymous
Not applicable
Author

 
@Sabrina:
Sorry my coding Abilities and Understanding for it  are not as high as you might think.  ; ) 
1. Your Second Code as youve  recommend looks like this in the Subject Line :  The exception is:null
2. So as far as I understood ... In your example  Solution i have to set an context variable to the component ( ex. tJavaRow) like this:
    0683p000009MCXw.png
I think it is similar with the method which Arnaud pointed out with th exception that the context still exist based on the schema  and your method needs an extra context variable .. or ? 
Edit: Some added Text for explaination 
regards john 
Anonymous
Not applicable
Author

Don't get me wrong .. the solutions are quite enough and sufficient for us ...
Thanks for that...
Neverthless I just want to understand the 2cnd Solution from Sabrina.
regards john
Anonymous
Not applicable
Author

Hm seems that is a little bit difficult to understand .. what i wanted to know further 
But ... I think i can live very well with the solution from arnaud.
so thanks for helping guys  
regards john