Event handler not saving script
-
Hi Folks,
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.
All I want to do is set a binary point every time the advanced scheduler fires (preferably without emailing...) .
Happy to take any advice but I cannot progress further if the script will not save...//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.
Am using mango 3.4.1
-
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.
-
Well I certainly have this configured under the Scheduler Events tree in Event types under the Event Handlers page.
Oh I see! man after all this time.... and I never even once noticed the type was a drop down.
Need more coffee...
And a holiday I think..Thanks Jared!