Monday 29 June 2009

Outlook 2007 and HTML email

Well, this can seem to be a little of topic :)

I was generating HTML e-mails that are sent via SharePoint (SendEmail method). But the e-mail wouldn´t render correctly in Outlook 2007. The e-mail was just cut off in Outlook 2007. I ran the HTML that was generated in validators and making sure that all tags was closed but nothing seemed to make me come closer to the solution.

Finnaly I stumbled across the solution! The problem was that I created a long string without linebreaks (\r\n)!

So my guess is that Outlook 2007 reads the HTML into a pre-definied string buffer and the parses it for output and in this case the HTML I sent was to long for this buffer.

Thursday 25 June 2009

Unable to break role inheritance

A customer had a problem to break the inheritance from the parent web. The error message on the first page was "500 Internal server error" and when breaking the inheritance from Site Settings was:

“Cannot complete this action.
Please try again. at Microsoft.SharePoint.Library.SPRequestInternalClass.ResetSecurityScope(String bstrUrl, UInt32 dwObjectType, String bstrObjUrl, Guid guidDoc, Boolean bUnique, Boolean bCopyRoleAssignments, Guid& pguidScopeId, Int32& piError)
at Microsoft.SharePoint.Library.SPRequest.ResetSecurityScope(String bstrUrl, UInt32 dwObjectType, String bstrObjUrl, Guid guidDoc, Boolean bUnique, Boolean bCopyRoleAssignments, Guid& pguidScopeId, Int32& piError) “

Inspired by this solution I just broke the inheritance of the permission levels and inherited it again to fix the issue of not being able to break the role inheritance.

Fast recap:
Browse to http:////_layouts/role.asxp
Break the inheritance
Enable the inheritance again

// Henrik

Tuesday 9 June 2009

Another surprise in SharePoint

I have a list with versioning enabled and a "Multiple line of text" field that can not be updated via the UI. The field is also configured to append text to the current text.

When updating the field and using SPItem.SystemUpdate(false) (in code) the field don´t get a new entry (as it does when editing a field of this type via the UI). Nope, it simply overwrites the current text and updates the field.

One solution to this is to concatenate the old value with the new, with the drawback that the datestamp will always stay the same until a new version of the item is created.
I removed the append option and did the appending of the field myself instead.

// Henrik

Wednesday 3 June 2009

"Copy to GAC" problem with WSPBuilder

See this thread for a solution to the problem. It seems that all application pools needs to be running for it to work.

// Henrik