Question

Show message with dynamic content

  • 5 November 2021
  • 3 replies
  • 41 views

Userlevel 3
Badge +4

Hi,

I have a task that generates an invoice. Before I checked in the sql code some values, and showed an error if a certain value was missing and stopped the code. When this first value was corrected, it could break on the next mandatory value. And so on.. not very user friendly…

 

To improve on this, i've done the following. 

Process flow is triggered by a dummy task. → a Decision checks if all mandatory values are okido (name, vat, billing address, debtor code).  → if not ok, show relevant (ie; say what is missing) message. / if ok., execute task to generate invoice.

In general, this is ok; 
However, if 1 or more values are missing, I want to show 1 message. 

Example. 

Scenario 1: message; “Debtor code, vat code, and billing address are missing. “

Scenario 2: message; "Debtor code is missing.”

Now, I have a process flow that, based on the outcome in the decision, shows a message. But that means (I think) I must create a matrix for all possible outcomes. So, I currently test for 4 values, I have already 9 possible outcomes of values missing (1234,12,13,14,234,23,24,34,4) making it not practical. 

Is there a better way of doing this? 

Thanks! 

Alex 

Current flow, with 3 message (debtor missing, vat missing, both missing).

 


3 replies

Userlevel 6
Badge +18

Hi,

You can do just one message with the translation {param}, then in your decision create the text that should be shown and set @param to be equal to that value. It sadly does limit you to one language (or multiple if it can obtain the translation from somewhere)

Else you could use exec tsf_send_message 'generic_message’, @param, 0 --(or 1 depending if it should abort)

Does that help out?

Userlevel 3
Badge +4

Yes, that is an option. I have this working well, except for 1 issue. 
I can’t format my text. I need a line break after each error. 

So, i set my message; 

   set @errormessage =  
+ isnull(@debtor_code,'Debtor code is missing')
+ char(13) + '\r\n'
+ isnull(@vat_code,' Vat_code is missing ' +char(10))
+ isnull(@address,' Billing address is not complete')
+ 'Would you like to set these credentials?'

And in my message I do; 

 

And this displays the message correct; 

 

Except the line break/CR/char(10) is ignored. 

How can I set this? 

 

 

 

 

Userlevel 6
Badge +18

Hi,

With XML

  1. Carriage return
  2. Line feed


Reply