Tuesday, February 2, 2010

Microsoft.SharePoint.SPException : "Cannot complete this action.\n\nPlease try again."

Today I got the "Cannot complete this action.\n\nPlease try again." exception when trying to save data in a Document Library. The full exception is:

Microsoft.SharePoint.SPException was caught
Message="Cannot complete this action.\n\nPlease try again."
Source="Microsoft.SharePoint"
ErrorCode=-2147467259
StackTrace:
at Microsoft.SharePoint.Library.SPRequest.GetListItemDataWithCallback(String bstrUrl, String bstrListName, String bstrViewName, String bstrViewXml, SAFEARRAYFLAGS fSafeArrayFlags, ISP2DSafeArrayWriter pSACallback, ISPDataCallback pPagingCallback, ISPDataCallback pSchemaCallback)
at Microsoft.SharePoint.SPListItemCollection.EnsureListItemsData()
at Microsoft.SharePoint.SPListItemCollection.Undirty()
at Microsoft.SharePoint.SPBaseCollection.System.Collections.IEnumerable.GetEnumerator()
at XXXXX.SharePoint.XXXXXX.XX_XXX_FormUC.SaveOrSubmitSOW(String strSaveOrSubmit)

And the line from which it has been thrown is:

foreach (SPListItem objItem in objSPList.GetItems(objSPQuery))

The solution to my case is pretty peculiar one!! The Columns with type Hyperlink was not working properly. You need to delete those columns and create again. If then also it doesnt work, change them to text mode and handle the hyperlink functionality in the code behind file.

1 comment: