Hello,
I'm trying to get the history alarms based on a time range and a property value. I created the following AlarmFilter but it doesn't seem to be working:
var alarmFilterByProperty = new AlarmFilterItemString(AlarmFilterField.PropertyValue, propertyName, AlarmFilterCompareType.Equality, new[] { propertyValue });
var alarmFilter = new AlarmFilter { FilterItems = new AlarmFilterItem[] { alarmFilterByProperty, }, };
Is there something that I'm missing in the filter? Or may the problem be in the SLNetMessage (I'm using GetAlarmDetailsFromDbMessage instead of the AlarmRepository)?
Hi Sebastian,
This syntax looks correct. Do note that you should use Type.Name as propertyName e.g. Alarm.Level. Not sure if this is the case.
It should not be a problem to use the GetAlarmDetailsFromDbMessage as Cube uses the same message to load the history tabpages in the alarmconsole.
What property name are you using? Be aware that for AlarmFilterField.PropertyValue, the property name should have a prefix indicating the source of the property, e.g. "alarm.xxxx" ,"element.xxxx", "view.xxxx" or "service.xxxx"
I was missing the AlarmFilterField, thanks for adding the different prefixes.
Hi Sebastian,
Maybe indeed it's the GetAlarmDetailsFromDbMessage , can you share me the full script or context?
That was indeed what I was missing. I was not including the Type to the propertyName.
Thank you!