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

addorupdatealert method not working?

Highlighted
Newbie

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

Tags (2)
6 REPLIES 6

Re: addorupdatealert method not working?

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.

Re: addorupdatealert method not working?

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

Re: addorupdatealert method not working?

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?

Re: addorupdatealert method not working?

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.

Re: addorupdatealert method not working?

can I refresh the composer programatically

rather than maually?

Re: addorupdatealert method not working?

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

so Where can I raise a bug ?