About Me


  • Enterprise Solutions Architect with 11 years of experience
  • Expertise on Microsoft Technologies, ECM, Open Source, Mobility
  • Expertise on SharePoint 2010, MOSS 2007, .Net 4.0 & More
  • Solution Design, Capacity Planning, Performance Tuning, Disaster Recovery
  • Migration experience from Lotus Notes, Plum Tree to SharePoint & Microsoft Technologies

Showing posts with label MOSS. Show all posts
Showing posts with label MOSS. Show all posts

Wednesday, April 9, 2008

Sharepoint 2007 Alerts are not working

Finally I managed to resolve this problem in my case.

Issue:
We have implemented a MOSS solution which contains a few custom lists. We have also configured alerts and customized them to suit the customer’s requirements.

Alerts were working fine but about suddenly they stopped working for one particular list. Alerts are working for all other lists/document libraries/etc. without any issues. If we check the content DB of MOSS, we can see the alerts are getting created successfully. But the emails are not being sent. We get confirmation emails that a new alert has been created, so message flow seems solid.

So, I then took a backup (by creating a List template with content), and recreated a new list with the same data and configuration. Alerts are working fine in the new list which has the same configuration and data. But with this approach we will lose Created/Modified and Author/Editor details.

Solution:

So, to resolve this issue I restarted the SPTimerV3 service (windows SharePoint timer), restarted IIS in all the servers. Thought this will resolve alerts issue. But no luck. Also, rebooted the machine (I know it doesn't make any sense but we wanted to try it) “

So, did google search and tried all the options provided in the following articles.... Also, contacted Microsoft support to help us out on this. But they are not sure about the problem.

http://weblogs.asp.net/mellota/archive/2007/10/11/sharepoint-2007-task-notification-alert-emails-not-working.aspx

http://www.moss2007.be/blogs/vandest/archive/2007/11/23/sharepoint-immediate-alert-notifications-stopped-working.aspx
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2150023&SiteID=1
http://suguk.org/forums/thread/6756.aspx
http://www.sharepointblogs.com/mindykelly/archive/2007/08/01/alerts-not-working-in-moss.aspx

As none of the option above help me to resolve the problem. So, thought of deleting the list and recreating list by losing out Created/Modified and Author/Editor details. But to my luck, I wanted to try removing all the alerts in the portal and test.

So, I created an application which will allow to take backup/restore all the alerts in the portal. After taking backup of all the alerts in the portal. I deleted all the alerts and then created one sample alert and tested, to my luck Alerts started working without any issue.

So, I restored all the alerts back without any issue. Now Alerts are being sent from the "troubled" list. Looks to you bit silly. But it is true... if you are working on MOSS 2007, be prepared for these kind of issues.

I hope this post will help someone, as I spent many frustrating days to resolve this issue.

Saturday, March 29, 2008

Custom Script while submiting a list item in MOSS

Here is another trick to add custom validations or script while submiting a listitem in NewForm.aspx or EditForm.aspx.

When you click on OK or Submit in NewForm.aspx or EditForm.aspx, it will execute following script to submit the data into SharePoint DB.

if (!PreSaveItem()) return false;
WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(<>, '', true, '', '', false, true))
theForm.submit();


So, if you want to add custom validation or script before submiting, then add a Content Editor WebPart in the same page with following script.

< language="javascript">
var submitButton = document.getElementById("<>")
submitButton.onclick = updateButton;

function updateButton()
{
//
// Add custom code to validate a page or any other functionality
// which needs to be performed before submiting a page
//

if (!PreSaveItem()) return false;
WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(<>, '', true, '', '', false, true))
theForm.submit();
}
< / script>


in the sameway, you can add confirmation message for cancel button

function updateCancelButton()
{
var conf = confirm("Are you sure you want to cancel?");
if (conf)
{
STSNavigate('\u002f');return false;
WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(<>, '', true, '', '', false, true))
}
}

I hope this helps. Happy coding...

SharePoint Customization

Here is the procedure to customize Multiline text box and Multi select box in MOSS 2007.

  • To increase the size of Multiline textbox, modify width in .ms-long class.

If you want only modify in one page then add a content editor Webpart in the page and place the following code inside.

This will change only in that particular page. If you want this change to apply for the entire portal then modify Core.css file.

  • To increase the height and width of Multiple selection list box. Then you have to modify “SPHtmlSelect_Adjust” function in

“C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\GroupedItemPicker.js”.

function SPHtmlSelect_Adjust(oSelect)

{

var oDiv=oSelect.parentNode;

if (oDiv.tagName !="DIV")

return;

if (oSelect.options.length <>

oSelect.size=20;

else

oSelect.size=oSelect.options.length;

var widthDiv=oDiv.clientWidth;

var widthSel=oSelect.offsetWidth;

if (widthSel <>

{

oSelect.style.width=widthDiv+"px";

}

if (oSelect.selectedIndex <>

return;

var pos=Math.round((oSelect.selectedIndex * oDiv.scrollHeight / oSelect.size));

if (pos <>

{

oDiv.scrollTop=pos;

}

else if (pos > Math.round(oDiv.scrollTop+oDiv.clientHeight - (oDiv.scrollHeight / oSelect.size)))

{

oDiv.scrollTop=Math.round(pos - oDiv.clientHeight+(oDiv.scrollHeight / oSelect.size));

}

}