Monday 15 August 2011

Exception from HRESULT: 0x80040E14

Hi All,

Most of the time, when you are trying to add a new record in Sharepoint 2007 List, you may face this error (Exception from HRESULT: 0x80040E14). So, don't worry, this error came, due to low diskspace in your Database Server.

To check the database server, please have a look on the attached images below:

This is the error that you may face while adding any new reocrd to the SharePoint List (MOSS2007).
To check details about error, open the event viewer in the server.

How to open the EventViewer

Go to RUN, type eventvwr, to open all the event that runs in the server. Check the lastet log error as below.
Then, open the content database in SQL Server Express, and go to properties as below

When you will open the properties, you can able to see two values (1. Size 2. Space Available ).
In mycase, my content database size is 4834.69 MB and Available Size is 1.18 MB. 


So to resolve this issue, you have to increase the size of your content database.

Thanks
Chandan Kumar Badajena 

Tuesday 2 August 2011

STSADM Commands in MOSS2007

STSADM tool is used for command-line administration of Office SharePoint Server 2007. Stsadm is usually located at "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN" and the user must have Administrative rights to use this tool. This tool provides access to the complete set of operations on the SharePoint Server 2007.

STSADM proves to be a boon when used with SharePoint migration tasks. One can easily carry out the IMPORT / EXPORT and BACKUP / RESTORE operations. The commands for these operations are listed below:

BACKUP:

stsadm.exe -o backup -url [site collection url] -filename D:\sitebackup\filename.bak

If the same file name is exist in the same location , then you have use the -overwrite command to overwrite the existing file with same name.

stsadm.exe -o backup -url [site collection url] -filename D:\sitebackup\filename.bak -overwrite

RESTORE

stsadm.exe -o restore -url [site collection url] -filename D:\sitebackup\filename.bak -overwrite

EXPORT

stsadm.exe -o export -url [site collection url] -includeusersecurity -nofilecompression -filename D:\sitebackup

IMPORT

stsadm.exe -o import -url [site collection url] -includeusersecurity -nofilecompression -filename D:\sitebackup

Note: D:\sitebackup\filename.bak and D:\sitebackup is just an example of a physical location used to generate / consume the file

To determine the lock status of the site, you can use the following getsitelock syntax:

stsadm -o getsitelock -url http://server_name/

Once the lock status of the site collection is determined, you can use the noaccess parameter of the setsitelock operation to lock out all users to the site:

stsadm -o setsitelock -url http://server_name/ -lock noaccess

After the site has been backed up, you can use the none parameter of the setsitelock operation to remove all locks to the site:
stsadm -o setsitelock -url http://server_name/ -lock none

SharePoint 2007 – Hiding fields on NewForm.aspx and EditForm.aspx, the easy way

One of the limiting factors in using the default forms (NewForm.aspx, EditForm.aspx) is that there is no obvious way to hide columns from appearing in the form.  By default all columns in a list or document library will appear in your forms. 
After doing quite a bit of research on this I found a fairly easy way to hide fields by using JavaScript within the form pages themselves.  In my research I found several different sets of JavaScript code, but some of the scripts are easier to implement than others.  Below I provide the best and most straight forward JavaScript and some simple steps to guide you along.
To hide fields in a SharePoint 2007 form, follow these steps (I will use the NewForm.aspx in my example)
  1. Open SharePoint Designer and navigate to the site that contains the list or document library you wish to customize.
  2. Expand the folder named “Forms” under the desired list or document library.  You should see about seven .aspx pages (AllItems.aspx, EditForm.aspx, NewForm.aspx, etc)
  3. Open the NewForm.aspx page and switch to the “code” view to edit the HTML of the page.
  4. Paste the JavaScript code immediately below the the following HTML tag <asp:Content ContentPlaceHolderId=”PlaceHolderMain” runat=”server”>  This will add the JavaScript to the HTML inside the content placeholder tag.  Note: be sure to include the entire script below, including the <script and </script> tags.
  5. Modify the “hidefields()” section of the JavaScript code to refer to each SharePoint list field name to hide.  For example, the code sample below will hide the SharePoint fields named Title, Document Link, and PublishDate    Notice that you do not need to worry about internal field names or field types like other JavaScript techniques, you simply need to know the name of the field.
  6. Save the changes.  Select “Yes” when prompted to “…customize the page from the site definition…”
  7. Test the form
<script language="javascript" type="text/javascript">

_spBodyOnLoadFunctionNames.push("hideFields");

function findacontrol(FieldName) {

   var arr = document.getElementsByTagName("!");
   // get all comments
   for (var i=0;i < arr.length; i++ )
   {
      // now match the field name
      if (arr[i].innerHTML.indexOf(FieldName) > 0)
      {         return arr[i];      }
   }
}

function hideFields() {

   var control = findacontrol("Title");
   control.parentNode.parentNode.style.display="none";
   control = findacontrol("Document Link");
   control.parentNode.parentNode.style.display="none";
   control = findacontrol("PublishDate");
   control.parentNode.parentNode.style.display="none";

}
</script>