POWEROBJECTS

718 Washington Ave. N. Suite #101
Minneapolis, MN 55401
View map and all Locations

Send us a message

In the course of implementing Microsoft Dynamics CRM, you will inevitably make configuration changes after records have been added to the system. When the configuration change is the addition of a Boolean field (also referred to as a two-option or yes/no field), it can present problems for anyone attempting to build a query that references this field. A Boolean field should only have two values. As such, it should not matter whether you use “equals” or “does not equal” as the operator in your query. However, if a record exists before the Boolean field is added to the entity, that field will have a null value.

Boolean

Boolean

This creates a situation where there are actually three possible values for the field within the system: No (0), Yes (1), and null. If a query uses “does not equal” as shown below:

Boolean

All of the null values, as well as the other value that was not excluded, will be returned as results.

Boolean

When including Booleans as part of a query, whether via an Advanced Find, in workflow check conditions, or in SQL queries, you should always keep in mind the possibility of a null value and choose your operators with care.

Want to learn more about Advanced Find in Dynamics CRM? Check out these articles for more handy tips and tricks:

Happy CRM’ing

Avatar for JoeCRM

JoeCRM

Joe CRM is a CRM superhero who runs on pure Microsoft Dynamics CRM adrenaline. As the face of PowerObjects, Joe CRM’s mission is to reveal innovative ways to use Dynamics CRM and bring the application to more businesses and organizations around the world.