Skullcrusher's Blog

Andy Bonner's Blog at vbCity

vbCity Blogs moved to:
http://cs.vbcity.com/blogs
  Home :: Syndication  :: Login

Congratulations! You've managed to stumble across the mad rantings of Andy Bonner aka Skullcrusher

Here you'll find all sorts of hopefully useful info on MOSS (Microsoft Office SharePoint Server) and things .NET related. You might even find other useful gems if I get around to it.


You can contact me on the address below, but I won't guarantee a response 8-}

OctNovember 2009Dec
SMTWTFS
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

Articles

Archives

Topics

Image Galleries

MOSS/SharePoint Links

Thursday, December 18, 2008 #

Just to let anyone who might be interested know that my Blog has now moved to http://cs.vbcity.com/blogs/skullcrusher/default.aspx
posted @ 10:19 AM | Feedback (0)

Thursday, April 10, 2008 #

I found this great POST by the SharePoint Designer team for “Using Javascript to Manipulate a List Form Field”.  Unfortunately it didn't work very well for People Picker fields which is exactly what I needed to do today.

After some trial and error, and a bit of head scratching I finally came up with the follow which I thought I'd share, since when I was searching for a solution I found a lot of people in a similar situation with no solution posted.

Code CopyHideScrollFull
<script type="text/javascript">
_spBodyOnLoadFunctionNames.push("fillDefaultValues");

function
fillDefaultValues()
{
fillPeoplePickerWithCurrentUser('Submitted_x0020_By');
}

function
fillPeoplePickerWithCurrentUser(pickerName)
{
//get the current user from the welcome menu
var
currentUser = getCurrentUser();

//check to see that we've got it

if
(currentUser != null)
{
//get the people pickers input div
var
pp = getPickerInputElement(pickerName);
//set it to the current user if we've found it

if
(pp != null)
pp.innerHTML = currentUser;
}
}

function
getCurrentUser()
{
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);
}
}
}

function
getPickerInputElement(fieldsInternalName)
{
var result  = "";
var
divs = document.getElementsByTagName("DIV");
for
(var i=0; i < divs.length ; i++)
{
if(divs[i].id=="WebPartWPQ2")
{
var tds = divs[i].getElementsByTagName("TD");
for
(var j=0; j < tds.length; j++)
{
var cellHTML = tds[j].innerHTML;
if(cellHTML.indexOf('FieldInternalName="' + fieldsInternalName + '"') >= 0)
{
var innerDivs = tds[j].getElementsByTagName("DIV");
for
(var k=0; k < innerDivs .length; k++)
{
if(innerDivs[k].id.indexOf("UserField_upLevelDiv") > 0)
{
result = innerDivs[k];
break
;
}
}
}
}
}
}
return
result;
}
</
script>
. . .
posted @ 9:08 AM | Feedback (11)

Saturday, March 29, 2008 #

Well it's been a long time since I last posted so thought I'd share with you how easy it is to make a custom field type within SharePoint.

Check out this New Article

And see for yourself.

posted @ 3:21 PM | Feedback (1)

Wednesday, April 11, 2007 #

Every now & then I would get the first time launch message appearing when I was starting up VS 2005, which wasted lots of time & I finally got around to googling a solution.

It turned out that it was a problem with using roaming profiles ( I switch between virtual machines quite often for various development requirements which I thinks what causes it) & I found the solutions in this MSDN article

But I'll post it here as well for future reference


When any one of the Visual Studio family of products is used with Windows Roaming Profiles, the first time launch message that says "Visual Studio 2005 is configuring the environment for first time use. This might take a few minutes." might appear on every session startup. This might cause unnecessary slowdowns in startup performance.

To resolve this issue

Click on the Tools > Options... Select "Import and Export Settings", and change the path under "Automatically save my settings to this file:" to a path that is NOT under the "My Documents" directory.


posted @ 9:25 AM | Feedback (11)

Wednesday, December 20, 2006 #

Having got past the last hurdle I then had a need for getting a list of all the site users into a Drop Down list which has spawned this second article

posted @ 11:40 AM | Feedback (7)

Monday, December 18, 2006 #

I had the need the other day to get hold of a users full name within a web hosted InfoPath form and although I could easily get hold of the login name I couldn't get hold of the users full name.

After some playing around I came up with the method I describe in this article which I hope someone else will find useful

 

posted @ 12:36 PM | Feedback (61)