weird query error

weird query error

i  ran this filter SearchResult.RecordId = IndexDefinition.SearchIndexDefinition.RecordId on my aggregate query.Note:IndexDefintion is an input parameter of datatype record for a structure. But i get this error on my assignment '=" operator  Invalid Data Type
Incompatible data types in = operator ('Integer', 'Entity Reference (Integer)')".i tried to use some of the inbuilt entitityref conversion functions but when i run my app in my browser i get this message "unable to cast object of type System.Collections.BitArray' to type 'OutSystems.HubEdition.RuntimePlatform.ISimpleRecord'. that aggregate query is used in an autocomplete field.Please any help with regards to this will be appreciated.
Hi Tmlewin,

That runtime error looks rather weird. That said, how is SearchResult.RecordId defined, and how is SearchIndexDefinition.RecordId defined? What are their exact types?
sometimes, even they are the same, SS/Truechange does not recognize it for some reason.
just delete the filter, publish it, and add it again.

Firtsly apologies for the late reply

@kilian the SearchRecord is an entity so (SearchResult.RecordId) while the indexdefinition is a input parameter of structure record when put a filter in my aggregate using this expression SearchResult.RecordId = IndexDefinition.SearchIndexDefinition.RecordId  . i get the error posted above . but when i cast it in this way  SearchResult.RecordId = EntityRefFucntion(IndexDefinition.SearchIndexDefinition.RecordId )

.the error vanishes and i click one publish... but when i try to do a search based on that query in my app, i get this "unable to cast object of type System.Collections.BitArray' to type 'OutSystems.HubEdition.RuntimePlatform.ISimpleRecord'.. 

@j tried your suggestion but it didnt work

Hi Tmlewin,

I understand what you're saying, but I need more info to determine what may be wrong. Is there an eSpace you can share so we can take a look?