.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Custom Alert Filter Definition

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :SharePoint
I was trying to create custom filter definition. Requirement : Send alert when the body of discussion contains certain words. These words are to be configurable. I just followed the steps in this blog. http://blogs.msdn.com/b/sharepointdeveloperdocs/archive/2007/12/07/customizing-alert-notifications-and-alert-templates-in-windows-sharepoint-services-3-0.aspx Created seperate template xml and added the definition like below <Filters> <FilterDefinition> <FriendlyName>Post contains </FriendlyName> <ShortName>words or phrase </ShortName> <Query> <Where> <Contains> <FieldRef Name="Body" /> <Value Type="Note">hi</Value> </Contains> </Where> </Query> </FilterDefinition> </Filters> I'm getting some blank radio buttons in the alert configure page, not sure whether to add the custom entries to resource file, where to make changes in core resource file? The value I'm trying to search is hardcoded now in the CAML, I want some text box for entering the value. Please advise.

View Complete Post

More Related Resource Links

Creating a new root Site Collection using a custom site definition file (ONET.XML)

Using Powershell, I am trying to deploy the our custom solution to SP 2010.  The script is doing the following: Deleting the web application using Remove-SPWebApplication Creating a new web application using New-SPWebApplication Adding and deploying a series of WSP files (one of which has the site definition file in it) using Add-SPSolution and Install-SPSolution Create a root site collection based on the site definition file provided in the WSPs using New-SPSite I get the error "WARNING: Template is not found and is not applied." When I run Get-SPWebTemplate, my site definition does not show up. I saw this: http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/5ea46e07-a4b0-4bab-b698-9b6eeb695607 but I want a solution that does not involve me reloading a DLL, as, I feel there is something else I am forgetting. I have also tried: IISReset Resetting the timer service Cleaning the Cache (as described here: http://support.microsoft.com/kb/939308) Nothing seems to work.  Does anyone have any ideas?

Deploying custom 2007 site definition to 2010

For a customer I am upgrading their SharePoint 2007 enviroment to SharePoint 2010. After a succesfull upgrade I am stuck with one last annoying problem: when creating a publishing site collection using a custom definition the provisioning of the site definition  fails. Interesting about this is that the provisioning works from the central admin UI, but this customer has an custom webpart for creating site collections in a web application outside of Central administration. The simplified code for this is: public static bool Create(SPWebApplication webApp, string Url, string siteTitle, string siteDescription, uint lcid, string siteTemplate, string ownerLogin, string ownerName, string ownerEmail)         { SPSite site = null; try { SPSite newSiteCollection = webApp.Sites.Add(Url, siteTitle, siteDescription, lcid, siteTemplate, ownerLogin, ownerName, ownerEmail); newSiteCollection.Close(); newSiteCollection.Dispose(); site = GetRootSite(webApp); bool r = (site != null) ? true : false; return r; } catch { return false; } finally { if (site != null) site.Dispose(); }         } The exception is thrown when webApp.Sites.Add() is executed. The user we are logged in as, as wel the appID, are Farm Admin's. The ULS shows this exception: Exception thrown while fetching field by internal name 'Wiki_x0020_Page_x0020

Custom listbox filter

Hi, I'm trying to create a multiselect listbox filter control.  I was using Josh Heyes filters but I'm upgrading to 4.0 and this is no longer compatible.  I have created a new UserControl which inherits from QueryableFilterUserControl, but I can't work out what I need to put into the GetQueryable method.  It's very similar to the ForeignKey filter, it's just that I want the user to be able to select multiple items in the list. Can anyone help? Thanks, Emma

Custom OR Filter on XsltListViewWebPart

Hi, I am having some issues getting a custom document library that is being viewed in an xsltListViewWebPart to filter the way I want it to.   I have found 2 ways to filter down the list using user input. 1.) Add values to the FilterOperations collection based on user input. This works great when you are only trying to filter on one column, or narrowing down searches based on columns. My issue with this method is that I can't search for values in multiple columns (Can do Column1 and Column2 but NOT column1 or column2) 2.) Modify the xmlDefinition of the xsltlistviewwebpart and inject my own query into the xml. This works greats on actually filtering, I can filter down on whatever I want, however, when I do this, I lose ribbon functionality on all but the items that originally appeared on the first page. If you searched for something that returned the 1st and 1530th files in the list, you could use the ribbon on the 1st item, but all document specific ribbon controls are disabled for the 1530th file. There are thousands of documents in this library and the only reason you would search for it is because you want to edit the properties or something, so this is kind of a big deal.   What I am looking for is the best way to filter down the document library dynamically using OR statements and user input.   Any help would be greatly appreciated.

Custom Email Alert template creating links to DispForm.aspx

I have a requirement to customise the alert template for a standard blog post list. To do this I: 1. Created a copy of alertstemplate.xml 2. Copied the genericList alert template node and customised 3. Registered the new template file against the site collection, iisreset and finally assigned the new Alert template to the list, when alerts are created the custom template is emailed. The problem now arises that the 'View <Post Title>' in the toolbar section now creates a hyperlink to http..../Lists/Posts/Dispform.aspx?ID=xx rather than post.aspx. I have checked using sharepoint designer that the list supporting files has the correct display item form of Lists/Posts/Post.aspx. Additionally if I reset the alert template for the list back to use the Generic list template the same problem still occurs so this leads me to believe it is not the customisations that are the problem. Code used to assign the alert template to the Posts list: var ats = new SPAlertTemplateCollection((SPWebService) site.WebApplication.Parent); var newTemplate = ats[alertName]; if (newTemplate == null) { // We did not find the specified Template. throw new Exception("Failed to find template SPAlertTemplateType.NewsPost in the template collection."); } list.AlertTemplate = newTemplate; list.Update(); Any assistance will be most welcome, thanks in advance. Alan

Create a list definition without a Custom Content Type

is it possible to create a list definition without creating a custom content type?  I want to create a list definition and select "Custom List" and then I just want to add fields to the custom list and not create a content type that will show up in the SharePoint GUI.  Seems like to get the new fields to show up in the new and edit forms I have to add the fields to a custom content type.

Reg: Does Custom site definition created in SharePoint 2007 works in Sharepoint 2010



If one has created a custom site definition in sharepoint 2007, Once the whole site is migrated to sharePoint 2010 will that "custom site definition" created in 2007 will work without breaking in SharePoint 2010?

If No, what has to be done to make it work on 2010.






Seven entries per change in daily alert on a custom list


I have an alert on a custom list with "All changes", "Any changes" and "Send a daily summary" set.  In the daily email, each change entry is repeated 7 times.  I only have one active alert (if I had multiple, I'd likely get 7 email messages, not one with duplicate entries).

The version number of the item is consistent with only one change being made.  The SharePoint version is reported as  I don't have admin or physical access to this installation and can not see if there are any unusual features installed.

custom publishing site definition


What to do , so that  custom   site definition tab  should appear at site collection level only?

What to do , so that  custom   site definition tab  should appear at subsite level only?

what to do , so that particular site definition tab should not appear at particular subsite level at all.

Custom List View - filter blank value



I am creating a custom list view in SPD2010 and am having some problems. I want to have 3 filters (language, country and quarter). I have set these up as ASP drop down lists that auto postback and then I have defined the paramaters and linked them into the list filter.




This works fine and all 3 drop downs filter the list. The only problem I am having is if I want to search just on one column. The way I have it set up in the filter is

Country EQUALS [Country] AND
Language EQUALS [Language] AND
Quarter EQUALS [Quarter]

If I want to show all entries from Germany and not filter on Language and Quarter how do I do this? I have tried adding a "Please Select.." entry at the top of the list and setting the value to nothing but it does not work. I have had to create 3 seperate views but I would love to get these 3 filters working at the same time.

Is there a value in SP that I can use to filter on blank values or not consider the column at all? I have tried using nothing in the value and also tried NULL but neither have worked.

I have been trying to solve this for some time with no luck :( If anyone has any

Custom site definition for Publishing site





I am trying to create a custom site definition based on publishing site definition. But i get following error while trying to create a site collection based on this definition.


"The Office SharePoint Server Publishing Infrastructure feature must be activated at the site collection level before the Publishing feature can be activated."


below is my custom webtemp:

Code Snippet
<?xml version="1.0" encoding="utf-8" ?>
<Templates xmlnsSurprisews="Microsoft SharePoint">
<Template Name="CustomPUBLISHING" ID="10001" SetupPath="SiteTemplates\PUBLISHING">
    <Configuration ID="0" Title="CUSTOM PUBLISHING Site" Type="0" Hidden="FALSE" ImageUrl="/_layouts/1033/images/PublishingCollaborationSite.gif"
 Description="This template provides a custom publishing site."

Best Practice for connect SSRS Report Viewer Web part with custom filter web part (With Dropdown\Lis


To make a filter provider web part, I implemented the interface ITransformableFilterValues.
Implemented the various properties of the ITransformableFilterValues interface
and method that creates an instance of our filter provider.

[aspnetwebparts.ConnectionProvider("AccountFilter", "ITransformableFilterValues", AllowsMultipleConnections = true)]
public ITransformableFilterValues SetConnectionInterface()
return this;

Is this a best practice .Please share your suggestion.


Best Practice for connect SSRS Report Viewer Web part with custom filter web part (With Dropdown\Lis


To make a filter provider web part, I implemented the interface ITransformableFilterValues.
Implemented the various properties of the ITransformableFilterValues interface
and method that creates an instance of our filter provider.

[aspnetwebparts.ConnectionProvider("AccountFilter", "ITransformableFilterValues", AllowsMultipleConnections = true)]
public ITransformableFilterValues SetConnectionInterface()
return this;

Is this a best practice .Please share your suggestion.


custom Picture Library with site definition


How to use Picture Library feature  available at

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\FEATURES\PictureLibrary

to create the custom picture library with  site definition.

custom picture library has one more  column with dropdown values .

After search on google. I found that picture library List to be specified in onel.xml as follows

<configuration >


       -- speciify picture library  list


 here how I can specify my own picture library,Please let me know in exact words


Custom site definition with embeded master page


Hello All,
I am creating a custom site definition, which is based on STS site definition ( so my site is also a team site, just with the difference of name ). For that I have created a SharePoint 2010 site definition project in VS 2010. It works fine.

Now what I want to do is to create a custom master for this site definition. And I want to keep this master page in same project.  Can someone tell me how to do it ?

Note : I am adding a module to this project ( which adds a feature to the project, when there was no module, there was no feature in the project ). Next I am referring that feature in one.xml file under configuration->site feature node. I do not want to have a feature, I want it to be part of site definition. But can I embed in such way that every time a site is created based on my site definition, master page also get deployed to root site of site collection


Custom site definition with embeded styles


I am making a custom site definition. I am able to embed master page in my site definition. This is corresponding thread for it.

Now in same way I want to embed style sheets with site definition. How I can do it ?


Creating a Custom List Definition that uses InfoPath Form



I have created a custom list definition in Visual Studio 2010.  By default it is using the out of the box "pages\form.aspx" for the New/Edit/Display form rendering. 

I am just wondering if it is possible to use an InfoPath form as default for the New/Edit/Display form?

I have tried to create a custom list with custom info path form thru the UI, and export the site as WSP.  I have analysed the files and notice a few things:

1.) I need to add a XmlDocument section in the Schema.xml for displayifs/editifs/newifs.aspx

2.) I need to provision the xsn in "Lists/{List Name}/Item"

3.) I need to provision the *ifs.aspx in "Lists/{List Name}/Item"

As you see, some of the settings required the {List Name}.  That's mean I can't really create a list definition that is reusable because I need to know the List Name before hand. Is there any way to specify the path with some kind of variable instead of static list name?

Furthermore, I notice that the "Developer" tab is missing from the Ribbon when I modify form, hence I can do any code behind.  Is this a limitation, or is there a workaround?



Wilson | SharePoint Egg's Blog
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend