Showing posts with label SharePoint. Show all posts
Showing posts with label SharePoint. Show all posts

Thursday, August 5, 2010

These are the directions for clearing the SharePoint Configuration cache. Sometimes the Configuration wizard will fail with an error about processes being updated by the farm admin account, or the timer service jobs will have issues. The cache is simply there to keep the server from making calls to SQL to gather frequently used information. The cache will be recreated when you restart the timer service.

Here are the steps:
  1. Stop the OWSTIMER service on ALL of the MOSS servers in the farm.
  2. On the Index server, navigate to:
  3. Server 2003 location: Drive:\Documents and Settings\All Users\Application Data\Microsoft\SharePoint\Config\GUID and delete all the XML files from the directory.
    Server 2008 location: Drive:\ProgramData\Microsoft\SharePoint\Config\GUID and delete all the XML files from the directory.

  4. Delete all the XML file in the directory. NOTE: ONLY THE XML FILES, NOT THE .INI FILE.
  5. Open the cache.ini with Notepad and reset the number to 1. Save and close the file.
  6. Start the OWSTIMER service on the Index server and wait for XML files to begin to reappear in the directory.
  7. After you see XML files appearing on the Index server, repeat steps 2, 3 & 4 on each query server, waiting for XML files to appear before moving to subsequent servers.
  8. After all of the query servers have all been cleared and new .xml files have been generated, proceed to the WFE and Application servers in the farm, following steps 2, 3, 4 and 5 for each remaining server.
I found this list here.

Wednesday, April 14, 2010

Filtering for a Date Range on Data View Web Parts

So I was trying to set a date range on a data view webpart and found that the filtering was very limited. Luckily I found this article: http://blogs.msdn.com/sharepointdesigner/archive/2008/02/25/filtering-and-formatting-with-date-values.aspx#filter_list_on_today_offset. It is part of a larger article that talks about many different date filtering options in SharePoint. It solved my problem and is a good reference for the future.

Thursday, April 8, 2010

SharePoint Search Using Search Server Express 2008

Recently I have been setting up Search Server Express for our WSS 3.0 server. I had everything installed and configured (I used this guide to help me: http://technet.microsoft.com/en-us/library/cc297193.aspx) but I was receiving an error when I attempted to crawl the content. The error was: Access is denied. Check that the Default Content Access Account has access to this content, or add a crawl rule to crawl this content.

I double checked all of my settings and everything seemed fine. So I went to google to see if I could figure any thing out. I stumbled across this technet thread: http://social.technet.microsoft.com/Forums/en-US/sharepointsearch/thread/84f93fbe-f4a6-4683-b25b-b595b9006ad7. About 1/3 of the way down the page there is a comment from Sandeep Lad that fixed my issue perfectly. He also references this KB article: http://support.microsoft.com/kb/896861. I thought it wouldn't work for me since I am on Server 2008 but everything appears to be running smoothly now.

Friday, March 12, 2010

SharePoint Survey and PreSaveAction

So my company wanted to have employees take a quiz after viewing a PowerPoint slide about safety. So I created a new survey in SharePoint to accomplish that task. After completing the quiz they tested it and decided that they wanted the ability to have it graded. I thought no problem, I will just use a workflow. Then they added a new wrinkle, they wanted a message to be displayed when they clicked finish to show if they had passed and then only save the results if they pass. So I decided to go the route of JavaScript. After looking at several sites I came up with the following code(most of it was copy and paste from other sites):

---------------------------------------Begin Code----------------------------------------------
[script language="javascript" type="text/javascript">]
function PreSaveAction()
{
var questiononeselected = getTagFromIdentifierAndTitle("input","RadioButtons","Energy Control protects employees from injuries caused by:","value");
var questiononevalue = questiononeselected.value;

var questiontwoselected = getTagFromIdentifierAndTitle("input","RadioButtons","LOTO stands for:","value");
var questiontwovalue = questiontwoselected.value;

var questionthreeselected = getTagFromIdentifierAndTitle("input","RadioButtons","An “affected” employee is defined as:","value");
var questionthreevalue = questionthreeselected.value;

var questionfourselected = getTagFromIdentifierAndTitle("input","RadioButtons","An “authorized” employee is defined as:","value");
var questionfourvalue = questionfourselected.value;

var questionfiveselected = getTagFromIdentifierAndTitle("input","RadioButtons","Only “authorized” employees are allowed to remove Lockout tags.","value");
var questionfivevalue = questionfiveselected.value;

var questionsixselected = getTagFromIdentifierAndTitle("input","RadioButtons","Customers, vendors, and outside service personnel are not required to follow the Company’s Energy Control policy.","value");
var questionsixvalue = questionsixselected.value;

if (questiononevalue != "All of the above")
{
alert('Thank you for taking the quiz.\n Unfortunately you did not pass.\n Please try again after reviewing the presentation.')
return false;
}

if (questiontwovalue != "Lock out-tag out")
{
alert('Thank you for taking the quiz.\n Unfortunately you did not pass.\n Please try again after reviewing the presentation.')
return false;
}

if (questionthreevalue != "A person who operates, uses, or works around equipment that is receiving maintenance")
{
alert('Thank you for taking the quiz.\n Unfortunately you did not pass.\n Please try again after reviewing the presentation.')
return false;
}

if (questionfourvalue != "A person who performs maintenance on equipment")
{
alert('Thank you for taking the quiz.\n Unfortunately you did not pass.\n Please try again after reviewing the presentation.')
return false;
}

if (questionfivevalue != "True")
{
alert('Thank you for taking the quiz.\n Unfortunately you did not pass.\n Please try again after reviewing the presentation.')
return false;
}

if (questionsixvalue != "False")
{
alert('Thank you for taking the quiz.\n Unfortunately you did not pass.\n Please try again after reviewing the presentation.')
return false;
}

//debug alert
//alert('1. ' + questiononevalue + '\n2. ' + questiontwovalue + '\n3. ' + questionthreevalue + '\n4. ' + questionfourvalue + '\n5. ' + questionfivevalue + '\n6. ' + questionsixvalue);

alert('Thank you for taking the quiz.\n You answered all of the questions correctly.')
return true;
}
/*******
SharePoint Field Type identifier tagName Option
--------------------- -------------- ---------- ---------
Single Line of Text TextField input
Multiple Lines of Text TextArea input
Number TextField input
Currency TextField input
Choice (radio buttons) RadioButtons input
Choice (radio buttons) RadioButtons input value
Choice (dropdown) DropDownChoice select
Lookup (single)* Lookup select
Lookup (multiple) SelectCandidate; select
SelectResult
Yes/No BooleanField input
******/
function getTagFromIdentifierAndTitle(tagName, identifier, title, option) {
var len = identifier.length;
var tags = document.getElementsByTagName(tagName);
for (var i=0; i <>
var idString = tags[i].id;
var nameString = tags[i].name;
// get selected radio button value only
if (option == "value" && tags[i].type == "radio" && (identifier == "RadioButtons" && nameString.indexOf(identifier) == nameString.length - len)) {
var tagParentHTML = tags[i].parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.innerHTML;
if (tagParentHTML.indexOf('FieldName="'+title+'"') > -1) {
var radioButtons = document.getElementsByName(nameString);
var radioValue = "";
for (var x=0; x <>
if (radioButtons[x].checked) {
radioValue = radioButtons[x].parentElement.title;
break;
}
}
var o = document.createElement("INPUT");
o.type = "hidden";
o.value = radioValue;
return o;
}
}
// get radio buttons group
if (tags[i].type == "radio" && (identifier == "RadioButtons" && nameString.indexOf(identifier) == nameString.length - len)) {
var tagParentHTML = tags[i].parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.innerHTML;
if (tagParentHTML.indexOf('FieldName="'+title+'"') > -1) {
return document.getElementsByName(nameString);
}
}

// all other input or select type
else if (tags[i].title == title && (identifier == "" || idString.indexOf(identifier) == idString.length - len)) {
return tags[i];
}
}
return null;
}

[/script]
-----------------------------------End Code---------------------------------------------------

Some of the key things to notice are:

1. At the beginning you have the PreSaveAction function. This function is called every time someone clicks on the finish button. It is executed before anything is saved. If it returns true it saves the data, if it returns false it returns you to the survey(leaving all of your input) and nothing is saved.

2. The getTagFromIdentifierAndTitle function was found on the SharePoint Designer blog and is better described there: http://blogs.msdn.com/sharepointdesigner/archive/2007/06/13/using-javascript-to-manipulate-a-list-form-field.aspx. Basically it goes and gets the value of what is stored in the input fields. I found a modified version as the original didn't include radio buttons which were what I primarily used in my survey. It can be found here: http://sharepointmalaya.blogspot.com/2009/04/trigger-javascript-events-when-choice.html.

3. It also was important to pass the correct title to the getTagFromIdentifierAndTitle function. I found the titles by viewing the source of the page. It was found in a cooment that looks like this: Fieldname="Name of Field". It appeared right before the definition of each radio button. You then pass that name in as the title.

4. The rest of the code is mostly specific to the survey I created. It goes through and finds each of the input fields and then checks to see if they are correct. If any one of the answers is incorrect it sends them a message and returns them to the quiz. If they are all correct then it saves the quiz.

Well it was a fun adventure in JavaScript and I learned a few things. I am sure the code cloud probably be a little more efficient but it got the job done.

Wednesday, January 27, 2010

Good stsadm reference

I just wanted to post a link to this stsadm reference document:
http://www.helloitsliam.com/Downloads/Articles/Mindsharp%20STSADM%20White%20Paper.pdf

The stsadm is a powerful tool if used correctly.

Friday, January 9, 2009

A Few Solutions to Recent Problems

So I have had a couple strange problems recently that I thought I would post the solution to. I had several computers that wouldn't install automatic updates after XP service pack 3 was applied. I found that the way to solve this was to re register a dll file. If you just paste this: 'regsvr32 wups2.dll' in the run coomand box (start->run), everything then works great with automatic updates.

The other problem I had was with SharePoint v3. I set up a new SharePoint server for the company I am now working for. I setup a few simple things and was ready to start granting access to the main site. When I tried to add users or groups from active directory, I got the following error code: Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT)). I search for quite some time and tried many things but none of the solutions seemed to work. Then I came across this post: http://prequest01.wordpress.com/2008/11/27/unable-to-add-active-directory-users-to-the-sharepoint-groups/ . It solved my problem right away. I am not sure why this option was checked on the SQL server and I hope it does not crash any of our other database apps. It is unfortunate the Microsoft caused SharePoint to produce errors when inserting into the database.

Thursday, May 15, 2008

Creating a Custom List Form for a SharePoint List

I worked on this for a while so I thought I would put all the links in one place:

So I wanted to modify the Editform.aspx page for a custom list I had created. I needed the users to only see a few of the fields for editing. The rest of the fields were being populated by an InfoPath form. So I followed the directions in the following post: http://kalsing.blogspot.com/2006/11/create-custom-list-form-for-sharepoint.html

This worked and I was able to click on the link that was sent in the email to users letting them know they had anew form. then I went into the list and clicked on the 'Edit Properties' button. This returned me to the root SharePoint site and not the item. So I was a little baffled. So I looked through a blog post(http://weblogs.asp.net/jan/archive/2006/11/06/Custom-Edit-Forms-for-SharePoint-2007-Lists.aspx) by Jan Tielens about the same thing. I found that when you right click on the properties of the list in SharePoint designer that it had no edit form associated with it. Also when I tried to add my new form it would give me the following message: "The page you have selected does not contain a reference to the correct SharePoint list. Please select another page". So I finally found a solution here: http://forums.microsoft.com/technet/ShowPost.aspx?postid=2023228&isthread=false&siteid=17

It seems that you must hide the original generic editing webpart. Since I replaced it it removed some code it needed in order to reference the page. I hope this helps someone else who is having the same issue.

Friday, February 8, 2008

Accessing Sharepoint through UNC with SSL

Note: After further review I found that the following only applies to Vista.

So we installed SharePoint 2007 (MOSS) and migrated from 2003. One of the network admins comented that he could no longer UNC into SharePoint. I searched the web high and low and couldn't find any reason why it shouldn't work. I personally set up a network location folder to our corporate SharePoint enviroment for my use in Vista. Today when I looked at at the network location I noticed that it had listed in the details the UNC path to the folder. So I entered that in the run dialogue, and it worked. So I thought I would Share this with everyone.

First off I learned that if you have SSL enabled it need to look like this for the top level site of the site collection:
\\yoursiteurl@ssl\DavWWWRoot

If you want to access on of the subsites it just looks like this:
\\yoursiteurl@ssl\site

For non SSL deployments I was able to access the top level site with this:
\\yoursiteurl\DavWWWRoot

And for non SSL subsites it was the following:
\\yoursiteurl\site

Mabey I am still to new at this SharePoint administration thing and this should of been common knowledge, but I thought I would throw it out there for anyone else like me who couldn't quite figure it out.