entity query with attribute = nullidentifier()

I have two questions.

Assuming I have an entity Event and an entity Person with the attribute EventId and I want to show all who has not participated in any event (EventId = 0)

Q1) What is the difference between the following?

Person.Eventid = IntegerToIdentifier(0)

Person.EventId = NullIdentifier()


I have a search in the page. If the admin filters by a particular event, I want to show all participant of that events. If he choose not to show all event, I should allow him to do so.

Q2) Am i right to set the filter this way? (Assume i have a local variable SearchedEventId of type Event Identifier)

Person.EventId = SearchedEventId or SearchedEventId = NullIdentifier()

Hi EnthusiaticNewbie,

Answering to your questions:

1) "IntegerToIdentifier(0)"  needs to call a function to convert and give you the same as "NullIdentifier()". Therefore I'd say to use directly "NullIdentifier()".

2) Yes, you can use that expression.

My observations:

1) Why you opted to have an attribute EventId in Person entity? Do you have only one person in an event?

2) Is your "search filter" a dropdown, and do you have a select an option "ALL" specified in the special values list?

Cheers!