<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Event handler not saving script]]></title><description><![CDATA[<p dir="auto">Hi Folks,</p>
<p dir="auto">Am trying to set values based upon status of active flag from the advanced scheduler. However despite saving, the script written is not saved and is gone upon revisiting the page either by refresh or navigation.<br />
All I want to do is set a binary point every time the advanced scheduler fires (preferably without emailing...) .<br />
Happy to take any advice but I cannot progress further if the script will not save...</p>
<pre><code>//val is chosen datapoint to update
var resp;
HttpBuilder.get("http://oursite.com:80/rest/v2/schedules", {'Authorization':'Bearer TOKENHERE'}, {'xid':'TEST_SCHEDULE'})
	.err(function(status, headers, content) { //setErrorCallback for linguistic completion
		throw "Request got bad response: " + status;
	}).resp(function(status, headers, content) { //setResponseCallback
		resp=JSON.parse(content);
		print(JSON.stringify(resp.items[0].rtData));
		var pt = resp.items[0].rtData.active===false?0:1;
		print(pt);
val.set(pt);
		return true;
	}).excp(function(exception) { //setExceptionCallback
		throw exception.getMessage();
	}).execute(); //will print the help page then "true" if the resp function is executed. Otherwise will throw the error.
</code></pre>
<p dir="auto">Am using mango 3.4.1</p>
]]></description><link>https://forum.mango-os.com/topic/3597/event-handler-not-saving-script</link><generator>RSS for Node</generator><lastBuildDate>Sat, 06 Jun 2026 20:36:21 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/3597.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 20 Jun 2018 21:37:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Event handler not saving script on Wed, 20 Jun 2018 22:24:10 GMT]]></title><description><![CDATA[<p dir="auto">Well I certainly have this configured under the Scheduler Events tree in Event types under the Event Handlers page.<br />
Oh I see! man after all this time.... and I never even once noticed the type was a drop down.<br />
Need more coffee...<br />
And a holiday I think..</p>
<p dir="auto">Thanks Jared!</p>
]]></description><link>https://forum.mango-os.com/post/18975</link><guid isPermaLink="true">https://forum.mango-os.com/post/18975</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Wed, 20 Jun 2018 22:24:10 GMT</pubDate></item><item><title><![CDATA[Reply to Event handler not saving script on Wed, 20 Jun 2018 22:14:38 GMT]]></title><description><![CDATA[<p dir="auto">You should be creating an event handler for the scheduler event, you can use a "Set point value" handler to set a binary point value or use a script event handler.</p>
]]></description><link>https://forum.mango-os.com/post/18974</link><guid isPermaLink="true">https://forum.mango-os.com/post/18974</guid><dc:creator><![CDATA[Jared Wiltshire]]></dc:creator><pubDate>Wed, 20 Jun 2018 22:14:38 GMT</pubDate></item></channel></rss>