Skip to main content

SharePoint Blog

Go Search
  

Where I SharePoints with you about Microsoft SharePoint and more!

 Announcements

New blog site! 
by Dennis Alzoubi (Anis Alzoubi)
 12/5/2009 18:14
 
SharePoint Yes/No Field Value Differences!

I was working on retrieving list values in code from a sharepoint list that happened to contain a Yes/No field. I noticed that the field value returned from Edit form is different from Datasheet view!!

In Datasheet view, the value returned is ‘0’ for False and ‘1’ for True. But in Edit Form, they are returned as ‘False’ and ‘True’. Don’t know what Microsoft was thinking.

Keep that in mind when trying to use the value in code…

Version control issue with feature Office SharePoint Server Publishing Infrastructure
If you ever, out-of-the-blue, get the following error:
The file is not checked out.  You must first check out this document before making changes.
 
You may want to turn off version control for your site.
 
Site Actions --> Site Settings --> Modify Pages Library Settings --> Versioning Settings.
 
A tip for free! I wasted too much time finding that...
SharePoint  Not Sending Email on Task Assignment in A Workflow Task

This is an issue I came across after we backed up and restored our site to a new server, our emails stopped coming out from our tasks list.

So we did what any other admin would do! start digging around for answers and these are the first things we looked at:

  1. Check SharePoint Outgoing Email Settings: everything was setup as expected! and to make things even weirder, alerts were working just fine on our server and only task assignments were the ones that were not working, so that was not the reason.
  2. Check List Settings for E-Mail Notifications: E-Mail notifications were enabled!
  3. Check SharePoint Logs: nothing was in the logs at all! it seemed like SharePoint didn’t even know that emails were not being sent out, this made me think that the problem is after SharePoint execute the email sending process, so the logs were not helpful, plan B!
  4. Check Mail Server: the interesting part is that there were no emails in the outgoing queue, which means it never got to the email server to start with.
  5. Devil is Messing With Our Server! then I started looking for a priest to come and do exorcism on our server since I have done everything that I can think of to get emailing to work and then it hit me:
why don’t I try to create a new tasks list?

So I went to my workflow settings, and under tasks list, I selected New Tasks List, then went to the new tasks list and enabled E-Mail Notifications and BOOM, emails started working!

Seems like after you move your site from one server to another, some of your tasks lists will lose the ability to send emails on tasks assignment even if E-mail notifications are enabled.

Solution

Delete and recreate your workflow tasks list that the workflow is associated with.

Fix for Event Id: 5785 Publishing Cache

This was one of the annoying errors we got on out testing environment today and it almost made me pull my hair out! it turned out to be a simple fix though :)

Error

Event Type:        Error

Event Source:    Office SharePoint Server

Event Category:                Publishing Cache

Event ID:              5785

Date:                     8/27/2009

Time:                     2:29:16 PM

User:                     N/A

Computer:          MOSS

Description:

Unable to connect publishing custom string handler for output caching.  IIS Instance Id is '1', Url is 'http://moss/APWS/SWSWorkflow.asmx?WSDL'.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Solution

  • Go to your web.Config file for that site and open it in a text editor.
  • Navigate to httpHandlers section and make sure you remove the following line:

      <remove verb="*" path="*.asmx" />

After removing this line, you should no longer get the error in the event viewer.

Note: There are some other solutions on the web, but none of them worked for my case.

SharePoint – Send HTML Email with CC, BCC

This is something I needed for one of the projects I worked for in Omaha where they needed the ability to send HTML-formatted emails and be able to define the CC and BCC fields in the email.

 

So I created a method to do this :)

/// <summary>
/// Send an html email message
/// </summary>
/// <param name="web">SPWeb</param>
/// <param name="toEmail">email addresses, semi-colon seperated</param>
/// <param name="ccEmail">email addresses, semi-colon seperated</param>
/// <param name="bccEmail">email addresses, semi-colon seperated</param>
/// <param name="subject">email subject</param>
/// <param name="body">HTML email body</param>
public static void SendEmail(SPWeb web, string toEmail, string ccEmail, 
                             string bccEmail,
                             string subject, string body)
{
    if (!string.IsNullOrEmpty(toEmail))
    {
        StringDictionary headers = new StringDictionary
                                       {
                                           //{"from", "dalzoubi@the-e.net"},
                                           {"to", toEmail},
                                           {"cc", ccEmail},
                                           {"bcc", bccEmail},
                                           {"subject", subject},
                                           {"content-type", "text/html"}
                                       };
 
        SPUtility.SendEmail(web, headers, body);
    }
}
This can also be used with SharePoint workflows by calling this method from within a code activity
1 - 5 Next

 Bloggers Bio

 Code Snippets

Expand/Collapse Category.Net ‎(3)
Expand/Collapse Code Type : Dev. C# ‎(3)
Expand/Collapse CategoryJavaScript ‎(1)
Expand/Collapse Code Type : Dev. C# ‎(1)
Expand/Collapse CategoryWSS 3.0 ‎(24)
Expand/Collapse Code Type : Configuration ‎(7)
Expand/Collapse Code Type : Dev. C# ‎(17)

 ‭(Hidden)‬ Admin Links