Action ‘object reference’ error | Oracle Series
Issue
In CRM v8.x, calling an Action might fail with the error: ‘Object reference not set to an instance of an object’. The error provided no clues as to the source of the issue; the first thought was that our code was the issue.
Investigation
Debugging and tracing as we might, all clues led to a platform issue. Upon checking the input parameters, we noticed that some of them are optional. The Entity Reference parameters behave a bit differently when trying to reference them from WF Custom Step parameters: they have a separate entry in the dialogue and we have to choose the ID field from under the referenced Entity.
Now the error makes sense: CRM is trying to access a Field in a Null Object.
Solution
Passing an Empty GUID, and handling it in code as if it’s a Null value, resolves the issue.