Skip to main content

SharePoint Ninja

Go Search
SharePoint Ninja
  

TechElixir > SharePoint Ninja > Categories
Error 6562
This error occurs when the password/username needs to be reset for single sign on (i.e. for BDC). Go to the single sign on properties of the operations section of the central admin.
Reset the credentials for the BDC application or applications where the user/password combo might have expired or is about to expire.
Once you have set the credentials, you need to restart the Single Sign On Service. This can be found in the services via the control panel (Microsoft Single Sign On).
If you have a web farm, restart the service on the site that hosts the SSO (usually the central admin host) and then reset it on the other sharepoint servers.
Modifying DispForm, EditForm, and NewForm

Whenever you create a list or document library there are three new aspx pages created by SharePoint. Modifying these pages is somewhat of a challenge because if you delete the listform web part on any one of these pages it will break the list. The best thing to do is HIDE the default list form by changing the IsVisible property to false (in the code view via SharePoint Designer) and adding a custom list form by highlighting the zone (not the web part) and going to Insert->SharePoint Controls->Custom List Form… to put in your new list form. Choose the list you want to display and what you want it to do (Edit, New, or Display) and you are ready to customize the page.

Fixing a broken page

If you do this you will need to repair it. This involves copying code from somewhere else but not saving it until you have changed the GUIDs. The code for all three pages is very similar. It differs in only a few places. The two things that tell it what kind of page it is are the Control Mode and the FormType. They are as follows.

New – Control Mode is New and Form Type is 8
i.e.
<ControlMode xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">New</ControlMode>
<FormType xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">8</FormType>

Edit – Control Mode is Edit and Form Type is 6
i.e.
<ControlMode xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">Edit</ControlMode>
<FormType xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">6</FormType>

Display – Control Mode is Display and Form Type is 4
i.e.
<ControlMode xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">Edit</ControlMode>
<FormType xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">6</FormType>

A complete web part looks like this (for New)

<WebPartPages:ListFormWebPart runat="server" __MarkupType="xmlmarkup" WebPart="true" __WebPartId="{5FB7C1CC-28A2-11DE-9467-510556D89593}" >
<WebPart xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/WebPart/v2">

  <Title>Package</Title>

  <FrameType>Default</FrameType>

  <Description />

  <IsIncluded>true</IsIncluded>

  <PartOrder>1</PartOrder>

  <FrameState>Normal</FrameState>

  <Height />

  <Width />

  <AllowRemove>true</AllowRemove>

  <AllowZoneChange>true</AllowZoneChange>

  <AllowMinimize>true</AllowMinimize>

  <AllowConnect>true</AllowConnect>

  <AllowEdit>true</AllowEdit>

  <AllowHide>true</AllowHide>

  <IsVisible>true</IsVisible>

  <DetailLink />

  <HelpLink />

  <HelpMode>Modeless</HelpMode>

  <Dir>Default</Dir>

  <PartImageSmall />

  <MissingAssembly>Cannot import this Web Part.</MissingAssembly>

  <PartImageLarge />

  <IsIncludedFilter />

  <ExportControlledProperties>true</ExportControlledProperties>

  <ConnectionID>00000000-0000-0000-0000-000000000000</ConnectionID>

  <ID>g_52D6FB4E-28A2-11DE-B8BC-260556D89593</ID>

  <ListName xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">{4315DD75-9C4F-412D-9CAC-36D3737FA30A}</ListName>

  <ListItemId xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">0</ListItemId>

  <ControlMode xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">   New</ControlMode>

  <TemplateName xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm"> ListForm</TemplateName>

  <FormType xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">8</FormType>

  <ViewFlag xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm"> 1048576</ViewFlag>

  <Toolbar xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">None</Toolbar>

</WebPart>

</WebPartPages:ListFormWebPart>



If your web part has disappeared (SharePoint will yank it out if it conflicts with another web part) then you need to place it in the web part zone. Between <WebPartPages:WebPartZone runat="server" FrameType="None" ID="Main" Title="loc:Main"><ZoneTemplate> and </ZoneTemplate></WebPartPages:WebPartZone>

 

DON’T SAVE THE PAGE YET. You will need to get two GUIDs
There are a variety of places to get GUIDs (like Visual Studio) or you can go to
http://www.somacon.com/p113.php and get them. The two places you need to put them are where it says <ID> right under <Connection ID>. Replace the GUID after the g_

The second place is the _WebPartID GUID. Once you have done this then you can save the page.

What if the page still doesn’t work or if clicking New, Edit, or trying to display it causes an error

You can get some weird errors such an “Unknown URL” or it goes back to the home page. If this is happening you need to reset the properties of the list or document library. This is done via SharePoint Designer. Open up the list in SPD and right click on the list in question. You should see a properties option. Then click on Supporting Files. Choose the files you want for Display, Edit, and New (or you can leave them if they are correct). Next (and this is bolded for a reason) click on the Content Type Specific Forms and change it from Folder to Item. This is very important because it won’t take it you don’t. You should be good to go then. If things still aren’t working it is probably because you have duplicate GUIDs from copying. You can’t have any duplicate GUIDs even if they are in another list. You might think you have fixed your current situation but you have probably broken another list if you saved your GUIDs before getting new ones.

Custom Handling of 404 Errors

Handling 404 errors

This is the first step in creating a custom solution in handling 404 (file not found errors)

Pointing to a custom 404 error page in SharePoint 2007

  • Log onto the server running SharePoint Server 2007 or one of the web front ends (if you have a server farm).
  • Navigate to (%systemdrive%\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\LangID)
    i.e. c:
    \Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\1033
    Notes:
    • %systendrive% is the drive where the operating system is installed.
    • LangID is the language ID (1033 for U.S. English).
  • Find the file Sps404.html and make a copy.
    • For WSS 3.0 this file is called Error.htm.
  • Change the copied file name to something like Custom404.html
  • Put in your custom content. This must be an html file. If you want it to redirect to an aspx file you can put in a redirect.
    • You may have to make the file larger than 512 bytes for it to work. You can do this by adding filler comments

Next you need to create a console program with Visual Studio (2005 or later).

-for more help creating console programs go to http://msdn.microsoft.com/en-us/library/ms438026.aspx

The code

using System;
using System.Web;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;

namespace CustomError
{
class Program
{
static void Main(string[] args)
{
System.Uri webApplicationUri = new Uri(<Your site URL>);
SPWebApplication webApplication = SPWebApplication.Lookup(webApplicationUri); webApplication.FileNotFoundPage = "custom404.html"; //*put some comments here.
webApplication.Update();
}
}
}

 

Note: <Your site URL> is replaced with the URL of the site you want to apply the custom URL.

  • Run the console program on the sharepoint server.