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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

addorupdatealert method not working?

jshah-3
1-Visitor

addorupdatealert method not working?

I  ran AddOrUpdateAlert() code through a service in order to create an alert progamatically

the code is taken from ptc page  Digital Media Publisher

when I run the service it executes successfully
but
I cannot see the alert on my property
I ran the generic method GetAlertDefinition()
It showed my thing but it is not showing it on the property

also when I save the Thing the alert disappears from  GetAlertDefinition() also

I cannot figure out why?
I have made sure that persistent is set to true in AddOrUpdateAlert()
also i tried restarting and enabling thing

Thank you for any help

6 REPLIES 6
ankigupta
12-Amethyst
(To:jshah-3)

Hi Jugal Shah​,

Try following: After running the Alert Creation service ; close your Thing entity (do not click the save button) and reopen it again.

Based on the information shared by you; it seems that Alert is created. It's just that your composer is not refreshed.

ankigupta
12-Amethyst
(To:jshah-3)

If it still not work. Share your entities and I can have a look.

jshah-3
1-Visitor
(To:jshah-3)

thank you it worked

but I have to manually close a thing

In my scenario in a service  I am iterating over a infotable (each row of infotable represents a different thing) and for each row I will be creating a alert

which means I am creating an alert for many things

Thus before running the service I have to make sure I close all the things in the infotable

Instead of manually closing it is it possible to problematically close a thing?

ankigupta
12-Amethyst
(To:jshah-3)

Hi Jugal Shah​,

We actually don't need to close the Thing. Saving the entity after running the service is overriding the changes done by service (in the background).

Just refresh the composer after running the service to load the latest entity data from the background. Make sure NOT to click save button before the refresh.

jshah-3
1-Visitor
(To:jshah-3)

can I refresh the composer programatically

rather than maually?

jshah-3
1-Visitor
(To:jshah-3)

I thing this can be consider  a bug in thingworx  know?

so Where can I raise a bug ?

Announcements


Top Tags