how to specify default value for people or group field in sharepoint with current user
Hi all, Can anyone tell me how can we specify the default value for people or group field with the current user id in sharepoint
December 18th, 2010 6:54am

Are u talking about populating default user information (including his user id / full name) in a list ? If Yes, then one of the ways i'd suggest is by following the following blog post by Laura Rogers. It works perfectly, the only caveat is your MOSS farm needs to be enabled with enterprise version and NOT standard. http://www.sharepoint911.com/blogs/laura/Lists/Posts/Post.aspx?List=676af157%2D7d96%2D4e15%2Da987%2D54b8a3e4d948&ID=73
Free Windows Admin Tool Kit Click here and download it now
December 19th, 2010 6:18am

Are u talking about populating default user information (including his user id / full name) in a list ? If Yes, then one of the ways i'd suggest is by following the following blog post by Laura Rogers. It works perfectly, the only caveat is your MOSS farm needs to be enabled with enterprise version and NOT standard. http://www.sharepoint911.com/blogs/laura/Lists/Posts/Post.aspx?List=676af157%2D7d96%2D4e15%2Da987%2D54b8a3e4d948&ID=73
December 19th, 2010 6:18am

Are u talking about populating default user information (including his user id / full name) in a list ? If Yes, then one of the ways i'd suggest is by following the below blog post by Laura Rogers. It works perfectly, the only caveat is your MOSS farm needs to be enabled with enterprise version and NOT standard. http://www.sharepoint911.com/blogs/laura/Lists/Posts/Post.aspx?List=676af157%2D7d96%2D4e15%2Da987%2D54b8a3e4d948&ID=73
Free Windows Admin Tool Kit Click here and download it now
December 19th, 2010 6:19am

Hi, Do you want to fill on list pages? (ie newform.aspx, editform.aspx etc) If yes then a small jaavscript can help you. 1. Add a CEWB on your page 2. Try to use below java script <script type="text/javascript"> _spBodyOnLoadFunctionNames.push("fillDefaultValues"); function fillDefaultValues() { var qs = location.search.substring(1, location.search.length); var args = qs.split("&"); var vals = new Object(getUserDisplayName()); var assignedToInput = getTagFromIdentifierAndTitle("div", "", "People Picker"); assignedToInput.innerHTML = vals; for (var i=0; i < args.length; i++) { var nameVal = args[i].split("="); var temp = unescape(nameVal[1]).split('+'); nameVal[1] = temp.join(' '); vals[nameVal[0]] = nameVal[1]; } } function getTagFromIdentifierAndTitle(tagName, identifier, title) { var len = identifier.length; var tags = document.getElementsByTagName(tagName); for (var i=0; i < tags.length; i++) { var tempString = tags[i].id; if (tags[i].title == title && (identifier == "" || tempString.indexOf(identifier) == tempString.length - len)) { return tags[i]; } } return null; } function getUserDisplayName() { var tags = document.getElementsByTagName('a'); for (var i=0; i < tags.length; i++) { if(tags[i].innerText.substr(0,7) == 'Welcome') { return tags[i].innerText.substr(8,tags[i].innerText.length); } } } </script> For more ref: http://blogs.msdn.com/b/sharepointdesigner/archive/2007/06/13/using-javascript-to-manipulate-a-list-form-field.aspx Hope this will help Cheers, Hemendra-MCTS "Yesterday is just a memory,Tomorrow we may never see"
December 20th, 2010 12:32am

Hi, Do you want to fill on list pages? (ie newform.aspx, editform.aspx etc) If yes then a small jaavscript can help you. 1. Add a CEWB on your page 2. Try to use below java script <script type="text/javascript"> _spBodyOnLoadFunctionNames.push("fillDefaultValues"); function fillDefaultValues() { var qs = location.search.substring(1, location.search.length); var args = qs.split("&"); var vals = new Object(getUserDisplayName()); var assignedToInput = getTagFromIdentifierAndTitle("div", "", "People Picker"); assignedToInput.innerHTML = vals; for (var i=0; i < args.length; i++) { var nameVal = args[i].split("="); var temp = unescape(nameVal[1]).split('+'); nameVal[1] = temp.join(' '); vals[nameVal[0]] = nameVal[1]; } } function getTagFromIdentifierAndTitle(tagName, identifier, title) { var len = identifier.length; var tags = document.getElementsByTagName(tagName); for (var i=0; i < tags.length; i++) { var tempString = tags[i].id; if (tags[i].title == title && (identifier == "" || tempString.indexOf(identifier) == tempString.length - len)) { return tags[i]; } } return null; } function getUserDisplayName() { var tags = document.getElementsByTagName('a'); for (var i=0; i < tags.length; i++) { if(tags[i].innerText.substr(0,7) == 'Welcome') { return tags[i].innerText.substr(8,tags[i].innerText.length); } } } </script> For more ref: http://blogs.msdn.com/b/sharepointdesigner/archive/2007/06/13/using-javascript-to-manipulate-a-list-form-field.aspx Hope this will help Cheers, Hemendra-MCTS "Yesterday is just a memory,Tomorrow we may never see"
Free Windows Admin Tool Kit Click here and download it now
December 20th, 2010 12:32am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics