web stats
get status of message and write it back into database - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 02-07-2019, 06:55 AM
con con is offline
OBX.1 Kenobi
 
Join Date: Nov 2018
Location: Berlin
Posts: 34
con is on a distinguished road
Default get status of message and write it back into database

I have a question that relates to a database command. And I want to write one value (e.g. ' done ') back in a table if the message was processed without error. If an error occurs, another should be written worth another (e.g. ' error ')

I've already tried with the message.isProcessed () method to get to the Status of the current message. Unfortunately, without success.
Reply With Quote
  #2  
Old 02-07-2019, 10:49 AM
Mits87 Mits87 is offline
OBX.2 Kenobi
 
Join Date: Nov 2016
Posts: 58
Mits87 is on a distinguished road
Default

var messagestatus = responseMap.get('destination1').getStatus();

that will give you sent, filtered or error and you can save that status as you need.
Reply With Quote
  #3  
Old 02-08-2019, 02:36 AM
con con is offline
OBX.1 Kenobi
 
Join Date: Nov 2018
Location: Berlin
Posts: 34
con is on a distinguished road
Default

thank you. I've found a solution within this post:

http://www.mirthcorp.com/community/f...ight=getStatus

next point for me is how to force a channel to write an error in JavaScript?
Reply With Quote
  #4  
Old 02-08-2019, 06:20 AM
con con is offline
OBX.1 Kenobi
 
Join Date: Nov 2018
Location: Berlin
Posts: 34
con is on a distinguished road
Default

Okay, your solution worked also for me. First i wanted to write everything in the Destination JavaScript Writer. But it is way more easy to ask if the Status is error or sent on the prev. Destination, which is a filewriter.

Thanks for your hint!
Reply With Quote
Reply

Tags
database, isprocessed, message

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 03:17 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation