• Rubenj
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies

Hi,

 

I'm trying to have a trigger do some validation upon insert and if some rules are not met then an error is displayed to the user and the data is not stored.  My problem is with the display formatting.  I'm trying to display something like:

 

Message 1

 

Message 2

 

To do so I have a block of code like:

 

string error_message = message1 + '\n\n' + message2;

f.addError(error_message);

return ;

 

The problem I'm facing is that I use this approach on two different objects an in one case it displays like I want it to and in another case it renders as "Message 1<br><br>Message 2".

 

Is there a particular way I have to format my error message to get the rendering to display properly?

 

Thanks,

Ruben

  • April 17, 2013
  • Like
  • 0

Hi,

 

I'm trying to have a trigger do some validation upon insert and if some rules are not met then an error is displayed to the user and the data is not stored.  My problem is with the display formatting.  I'm trying to display something like:

 

Message 1

 

Message 2

 

To do so I have a block of code like:

 

string error_message = message1 + '\n\n' + message2;

f.addError(error_message);

return ;

 

The problem I'm facing is that I use this approach on two different objects an in one case it displays like I want it to and in another case it renders as "Message 1<br><br>Message 2".

 

Is there a particular way I have to format my error message to get the rendering to display properly?

 

Thanks,

Ruben

  • April 17, 2013
  • Like
  • 0