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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Exception when trying to remove alert through service

kbanaszczyk
1-Visitor

Exception when trying to remove alert through service

Hello,

When i'm trying to remove alert through service RemoveAlert on thing i've got this exception:

com.thingworx.common.exceptions.InvalidRequestException: Alert [alertName] is an inherited alert on property [propertyName] and cannot be removed

Do you know why is that and how can I remove alert through service?

My TWX version is 6.6.0-b476

Thanks

Kamil

3 REPLIES 3
ttielebein
14-Alexandrite
(To:kbanaszczyk)

Is your alert located on a ThingShape or ThingTemplate? I would guess you need to remove the alert on the same level where it is defined, so if you define an alert on a ThingTemplate and try to remove it from a Thing which implements that ThingTemplate, then I would expect it to state an error like you are seeing

Hi, thank you for answer,

I'm creating alert also through service on thing level.

Kamil

ttielebein
14-Alexandrite
(To:kbanaszczyk)

Also commenting here for visibility. I believe this error message is hard coded in and will appear even if the alert does not exist or some other issue occurs. I will open a Jira to have this corrected, but in the short term, checking for the alert in advance using HasAlert may prevent this error from appearing.

This error SHOULD appear when you try to remove the alert on the Thing level, but the Alert is defined on the ThingTemplate level. Here, instead of removing the alert, you would have to disable it on the Things. You could remove the alert on the ThingTemplate level, but that will remove the Alert for all Implementing Things. In order to disable the alert on one of the Things while leaving the alert active on the rest, use DisableAlertForProperty on the Thing level.

Announcements


Top Tags