Announcement

Collapse
No announcement yet.

Send notification (error messages or other)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Send notification (error messages or other)

    Hello to everyone,
    I will ask an easy question. I use throw to give an error message when I write custom functions. But I want to send it as a notification. I mean, I do not want you to fall into log records.

    I am sending notifications as an error. This is not a good thing.

    My method;
    Code:
    throw new Error('Error Message.',400);
    What I'm looking for like this;
    Code:
    $this->sendNotification($state, $message);
    Thank you.

  • #2
    Hi,
    read application/Espo/Hooks/Common/Notifications.php and application/Espo/Core/Notificators/Base.php

    Comment


    • #3
      Yes, I saw and examined. But I can not, can you help?

      Comment


      • #4
        hey, No I'm not saying it. I'm misunderstood. UI error message.I don't want to use the throw error message.
        I'm using JS "this.notify('Okay', 'success');"

        I need php code.
        Attached Files
        Last edited by dangerdodis; 05-10-2018, 08:29 AM.

        Comment


        • #5
          So, what do you need? PHP or JS? need more information

          Comment


          • #6
            I am looking for PHP code for this code.

            JS code
            Code:
            $this->this.notify('Okay', 'success');
            But I want php.

            Comment


            • #7
              Code:
              throw new Error('Error Message.',400); // or other errors
              - is the only one way on the php, how you can affect on UI notice
              Last edited by tanya; 05-10-2018, 10:53 AM.

              Comment


              • #8
                Hi, is there any update in EspoCRM that i can show a custom error message using php? thanks

                Comment

                Working...
                X