3 Replies Latest reply on May 10, 2016 10:23 AM by ttielebein RSS
    kbanaszczyk Newbie

    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

      • Re: Exception when trying to remove alert through service
        ttielebein Collaborator

        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

        • Re: Exception when trying to remove alert through service
          kbanaszczyk Newbie

          Hi, thank you for answer,

           

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

           

          Kamil

            • Re: Exception when trying to remove alert through service
              ttielebein Collaborator

              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.