Skip to Content
Menu
This question has been flagged
2 Replies
1594 Views

I am getting an error  "Uncaught Javascript Error > this.displayNotification is not a function" 


--if(date_end "less than" date_start){---                     

----this.displayNotification({
----type: 'warning',
----title: _t('Success'),
----message: "Invalid",
----sticky: true

--}
--}


Avatar
Discard
Best Answer

Hi,

Please try with the following 

notification(){

    this.env.services['action'].doAction({

                'type': 'ir.actions.client',

                'tag': 'display_notification',

                'params': {

                    'title': 'Invalid fields:',

                    'message': "Project",

                    'type': 'danger',

                    'sticky': false,

                }

            });

}

Hope it helps

Avatar
Discard
Best Answer

Hi junaid,

can you try this way,

this.widget.displayNotification({
message: this.env._t("Session expired... Please refresh and try again."),
sticky: true,
});

Thanks.

Avatar
Discard