cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Add or Update Alert

svisveswaraiya
17-Peridot

Add or Update Alert

Hi,

I am trying to add a alert through services for a property from kepware. It shows me invalid attribute. This is the service and alertAttr is my infotable having (limit with data type int and limitInclusive with data type boolean)

How can I add an alert using AddOrUpdate service? Please provide some help.

 

var params = {
alertType: "Above" /* STRING */,
alertName: "MyAlert" /* STRING */,
property: "AM_Equipment1_Conductivity" /* STRING */,
attributes: alertAttr /* INFOTABLE */,
priority: 1 /* INTEGER */,
persistent: true /* BOOLEAN */,
enabled: true /* BOOLEAN */
};

me.AddOrUpdateAlert(params);

 

Thanks,

Shalini V.infotable.png

1 REPLY 1

Hello,

I have found one link which can give you more details on how to use AddOrUpdateAlert service. I am not sure if you have already visited this link.

https://support.ptc.com/cs/help/thingworx_hc/thingworx_7.0_hc/index.jspx?id=ThingWorxHelpCenterDITAFiles-ThingWorxModelDefinitionandComposer-Alerts-AddOrUpdateAlertServiceAttributes&action=show

If you are getting the invalid attributes error, maybe you have to verify once again the attribute infotable that you are setting.

Also I would recommend to try the following steps:

1) As a first step try to remove all the alerts from the property; first get all the alerts for the property using 'GetLocalAlertDefinitions' and remove them one by one using for loop.

2) Now Add your dynamic alerts using 'AddOrUpdateAlert' again in the same for loop as above

3) After for loop, Disable all alerts for the thing using 'DisableAllAlerts'

4) Now enable all the alerts using 'EnableAllAlerts'

Do all these steps in the try catch block just to be safe.

Thanks

Aditya

Top Tags