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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

addorupdatealert method not working?

jshah-3
1-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

6 REPLIES 6
ankigupta
5-Regular Member
(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
5-Regular Member
(To:jshah-3)

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

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
5-Regular Member
(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.

can I refresh the composer programatically

rather than maually?

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

so Where can I raise a bug ?

Top Tags