FindElementsByAttribute (and FindEventFramesByAttribute) matching against AFEnums

Discussion created by jsaret on Nov 11, 2010
Latest reply on Nov 11, 2010 by jsaret

I've encountered a problem when doing Attribute based searching against EventFrames, however I've confirmed this also occurs when doing an Attribute based search against Elements.




Basically to replicate this, what I've got is an Element (or EventFrame) Template that has an Attribute configured with an AFEnum as the ValueType, however no default value has been configured for this Attribute.  I then created a couple of Elements with this template and assigned a value to this Attribute on some of them.


When doing an Attribute based search against these guys (using either a string or the reference to the AFEnumerationValue), the search works perfectly if I look for an AFEnumValue that is not the first in the AFEnum (i.e. one with a value of 0), however if I specify the first AFEnumValue in the search, I get back Elements that either have this value, or nothing set as the Attribute value (i.e. NULL).


If i call GetValue on the Attributes with the empty value I get NULL back, so to me these guys shouldn't be coming back as a match in the search.


I was wondering if this behaviour is intended, and if so what is the best way to get around this issue.


One workaround that I've looked at doing is just create a "Blank" first AFEnum Value for all the Enums that I have to search against, and then just not allow the first "Blank" Enum value to be set as the value for the relevant Attribute, but if there is a better way of getting around this it would be great. Thanks