Thursday, January 20, 2011

InfoPath Error: Cannot Complete This Action. Please Try Again

I'm working on an InfoPath form that has code behind. I execute a button and it is supposed to do a SharePoint CAML Query and populate some fields on the InfoPath form based on data returned from the query.

When I click the button, I get an exception "Cannot Complete This Action. Please Try Again".  I looked in the SharePoint 2007 ULS logs and I saw the following error:

Unexpected query execution failure, error code 282. Additional error information from SQL Server is included below. "The 'proc_GetTpWebMetaDataAndListMetaData' procedure attempted to return a status of NULL, which is not allowed. A status of 0 will be returned instead." Query text (if available): "{?=call proc_GetTpWebMetaDataAndListMetaData(?,'ED02FBB9-7901-4CD2-9E42-7E5E1F690C37',?,NULL,1,?,?,6187)}"     
It turned out my CAML query was malformed. I was missing some close element tags. 

I changed <FieldRef Name = "Title"> to <FieldRef Name="Title"/> and that resolved the problem.

Hopefully this will help someone as the error message is pretty cryptic.

1 comment:

  1. That's not right. You'd need to use a forward slash on the end: />