Send notification (error messages or other)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dangerdodis
    Junior Member
    • May 2018
    • 26

    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.
  • tanya
    Senior Member
    • Jun 2014
    • 4308

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

    Comment

    • dangerdodis
      Junior Member
      • May 2018
      • 26

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

      Comment

      • dangerdodis
        Junior Member
        • May 2018
        • 26

        #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

        • tanya
          Senior Member
          • Jun 2014
          • 4308

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

          Comment

          • dangerdodis
            Junior Member
            • May 2018
            • 26

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

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

            Comment

            • tanya
              Senior Member
              • Jun 2014
              • 4308

              #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

              • Vincent
                Senior Member
                • May 2017
                • 176

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

                Comment

                Working...