cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Displaying errors & warnings simultaneously in the message popup

David21
Explorer
0 Kudos
637

Hello everyone,

I'm using CAP(Node.js) with odata(v4) & fiori elements. My requirement is to display error & warning messages in the same message popover similar to the one available in ui5 :

error.png

 With fiori elements you can use req.error() or req.warn() to show these messages, But the problem is when i use them both together only the errors are shown. The warnings are shown only if there are no errors. Is this the standard behavior or is there a way to show them both together ?

Accepted Solutions (0)

Answers (2)

Answers (2)

Dinu
Active Contributor

You can work around this CAP node.js behavior using an error handler:

 

    this.on("error", (err, req) => {

    if (req.messages) {
      err.details = err.details ? err.details.concat(req.messages) : req.messages;
    }
)

 

abelousov
Active Participant
0 Kudos
                    //req.error ("Sent with errors.");
                    req.messages.push ({ message:"Sent with errors.", numericSeverity:4 });