Thursday, September 13, 2012

Query Strings Found on SharePoint's List Forms

I love looking for an easier way and this time I've found one that previously worked just a bit weird before...

The issue I've had is when creating items in a particular folder within a list, you have to be very conscious of the BaseName. It MUST be unique within your whole list structure or else the save fails. Look at the comments in the documentation for more details.

I've been building a tree navigation and I've been developing a way to insert folders/items dynamically.  I just found an easier way to create folders wherever I need them to appear in the list. I no longer have to worry about the BaseName as SharePoint takes care of that for me. As I learn of more query strings, I'll append them to this post

Query Strings 

RootFolder=%2FSPDev%2FLists%2FLinkNav%2FmahFolder - Used to control the destination of where your new item will be saved.

Type=0 - Used to tell SharePoint whether you want a folder or an item. 0 = folder; 1 = item.

ContentTypeId=0x01040004B13BF0D61E0D44A7D0327C51C01D8A - Create the content type of your choice.

IsDlg=1 - This query string can be set to anything and will behave as if the form is in a modal. Sometimes this can cause issues because saves/cancels rely on window.frameElement and if the <iframe> isn't present, the form will not work properly.

That's all for now but I'm sure I'll find some more...