Skip to main content

Live Event

You can use the LiveEvent to enable an app to trigger certain actions whenever event received from Facilio Script. This will be useful for notifying custom messages on Facilio interface (eg: Critical alarms).

subscribeUserEvent#

app.liveevent.subscribeUserEvent(topic) - Is used to listen to custom user level events which are sent from Facilio script.

content = {};content.label = "some data";content.value = 1000;  message = {};message.to = <to user id>;message.topic = "new_alarm_event";message.content = content;log message;  new NameSpace("wms").sendMessageToUser(message);

subscribeOrgEvent#

app.liveevent.subscribeOrgEvent(topic) - Is used to listen to custom org level events which are sent from Facilio script.

content = {};content.label = "some data";content.value = 1000;  message = {};message.orgId = currentOrg.id;message.topic = "new_alarm_event";message.content = content;log message;  new NameSpace("wms").sendMessageToOrg(message);