Wednesday, June 1, 2011

The infamous No Attribute error

You have no doubt come across this error. While working on some enhancement you might be working in a CRM Form and receive the following upon saving:

Or you might notice that a workflow has failed and when you open it up, you’ll similarly see:

How would you troubleshoot something like this? This may vary depending on the circumstance but here are a suggested set of steps. Let’s assume the No Attribute error was received in a workflow process as shown in the second screenshot above.

  • Go into the form and attempt to update the same field that the workflow is trying to update. Chances are that you’ll get the No Attribute error as shown in the first screenshot above.
  • Assuming you received this error while saving on the form, use the CRM Diag tool to trace the error:
    • Open up the CRM Diag Tool
    • Click Enable on the tracing just before reproducing the error
    • Reproduce the error
    • Turn off tracing
    • Find the trace files under the Microsoft Dynamics CRM\Trace folder and open up
  • In the trace file search terms like “Error Report:”, “Error Message:” – this should bring you to the part dealing with the error that occurred
  • Doing the above you may come up with something like this:

>MSCRM Error Report:--------------------------------------------------------------------------------------------------------Error: 'Incident' entity doesn't contain attribute with Name = 'ci_deptsystemuserid'.

  • The above identifies the offending attribute therefore search through your plugins and associated images to see if this field is referenced and remove
  • For example, in our case, the attribute is referenced via a custom audit plugin that we developed (in CRM 4.0 prior to the advent of the out of the box version of CRM 2011) that was auditing the field in question:

  • Then again, if the attribute wasn’t deleted, we wouldn’t have hit this issue in the first place. However I have already espoused the virtues of keeping the system nice and clean in a former post and therefore I think it’s well worth the effort.

No comments:

Post a Comment