Question
How to unsubscribe to message when closing/cancelling/discarding the record page
07:11 Aug 01, 2023
Hi Community,
We have this functionality that we are subscribing to message on load of record page. How we can unsubscribe once we close/cancel/discard the record page.
Below is the code how we subscribe during record on load.
init: function() {
this.callParent(arguments);
this.subscriptionFunction();
},
subscriptionFunction: function() {
Terrasoft.ServerChannel.on(Terrasoft.EventName.ON_MESSAGE,
this.onMyProcessMessage, this);
},
Like
2 comments
17:33 Aug 01, 2023
To unsubscribe from the message when the page is closed/canceled/etc, add the following:
destroy: function() { Terrasoft.ServerChannel.un(Terrasoft.EventName.ON_MESSAGE, this.onMyProcessMessage, this); this.callParent(arguments); }
Ryan
Show all comments