3

SharePoint Gotcha – It may have been deleted or renamed by another user

I recently had an error on one of our SharePoint sites that is the worst kind of error a programmer could face. It only happens sometimes.

It was a typical SharePoint 2007 code error, very vague. "It may have been deleted or renamed by another user." This error message is completely imposable because I wrote the code and it was not deleted or renamed.

I re-checked the code. Double checked the store procedures. I even commented out lines of the code to see where the error "It may have been deleted or renamed by another user" might be originating from. Not matter what I did, I still got the error.

What made the error even more strange was the page in question uses a query string. If the ID was 1 – 13. The page loaded without problem. 14 or more, I got the error message.

After a Google search I found out what my problem was. It wasn't me, it was them!

"People may experience a problem with Query string Field named as ID when the application is custom coded for share point site.

Problem arises when you use ID as query string parameter.Ex: http:xyz:1000/Pages/EditItem.aspx?ID=1."

Full article

Now come on Microsoft, really? I can't use ID in any custom Sharepoint code. That is a first.

Click Here to Leave a Comment Below 3 comments
Gavin Morgan - November 2, 2009

Hi, When i change the querystring to anything other than ID none of the fields or the toolbar appears correctly, have you come across this ?

Reply
Mark Perry - November 3, 2009

But the fields and toolbar appear if you use ID in your querystring?

Reply
anon - January 28, 2010

When programming, you can’t blame the logic of the platform when you are coding against it. That’s the nature of the profession. It’s actually “you”, not “them”. The “them” is fixed and you have to adapt and figure out how to make it work with your users. There is a reason that “ID” is reserved (as illogical as it may seem). Reserved variables are common across many platforms. The solution is to use a slightly different URL parameter (e.g., “ItemID”).

Reply

Leave a Reply: