Tuesday, November 11, 2014

SharePoint Event Receivers that are running on a List

It is tough to find out running "Event Receivers" for a SharePoint list.
Here is a way using Power Shell script to know the Event Receivers bound to a List:

$web = Get-SPWeb -Identity "http://pc.gn.com/sites/CO"
$list = $web.Lists["Order List"]
$list.EventReceivers


Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$spWeb = Get-SPWeb -Identity "http://pc.gn.com/sites/CO"
$spList = $spWeb.Lists["Order List"]
$evts = $spList.EventReceivers
$evts
Write-Host("..." + $evts.Count)
if ($evts.Count -gt 0) {
            foreach ($evt in $evts) {
                Write-Host("..." + $spList.RootFolder.ServerRelativeUrl + ", " + $evt.Type)
            }
        }


TO delete an event receiver from a List:
Once you confirm  the event receivers, use below to delete them
Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$spWeb = Get-SPWeb -Identity "your site url"
$spList = $spWeb.Lists["TrackTravel"]
$evts = $spList.EventReceivers | where {$_.Assembly -eq ""your assembly"}
$evts
if ($evts.Count -gt 0) {
            foreach ($evt in $evts) {
                Write-Host("Deleting..." + $spList.RootFolder.ServerRelativeUrl + ", " + $evt.Type)
                $evt.Delete()
            }
        }

And the other way is:
To know the Event Receivers bound to a List and Events that ran on a List Item (Title: MI4803)
USE WSS_Content_XXX
SELECT * FROM EventReceivers WITH (NOLOCK)
where Class like 'GN.SP2010%'

select * from dbo.EventLog
where ListId = '1648253C-ED8F-44AE-B2EB-A19238102B41'
and ItemName = 'MI4803'

Thursday, April 24, 2014

Reports with SharePoint List as data source

[Draft}

One easy way to generate dynamic reports/metrics based on SharePoint List as data source is using SharePoint Designer and various List Views.

Other easiest way is using SSRS services on SharePoint and Report Builder 3.0 as report development tool.

To create reports using Report Builder 3.0 go through the link:

1. Install SQL Server Reporting Services with SharePoint Integration Mode and attach to the SharePoint Form. or install SSRS with SharePoint Integration Mode on any of the existing SharePoint Server.

2. Enable Reporting Services on SharePoint Form in Central Administration and make sure it is running and you can see SSRS related section on Central Administration.

3. Enable the below highlighted features and PerfornamcePoint Services to use PerformancePoint Dashboards/ScoreCards/KPI etc.




4. Create a document library and enable Content Types and add Reporting services related content types as described in this link.

Create A SharePoint Document Library To Store SSRS Reports



Reports in SharePoint - draft


You have various ways to create reports on SharePoint based on the various data sources like SharePoint List/Library as data source or external data sources like SQL Server/Oracle DB.

If the Oracle DB as your data source the only way to create reports and use in SharePoint is use some external reporting tools like Cognos/SAP BO/ etc and integrate them with SharePoint with the help of integration components.

If the data source is a SQL Server, you can use SSRS which has easy integration with SharePoint.

If the data source is SharePoint Lists/Library, you can use SSRS and Report Builder 3.0 as report development tool.

Document Library VS Record Library


 A Records Library is a document library but with a Records Management slant. It is available in the Records Center site by default but won`t be available in any of the other site templates.

Record library is a document library configured to "allow multiple content type", "Document check out before editing", "Versioning" etc.. including "Automatically declare items as records when they are added to this list".  So when a document is uploaded to a Record library it is declared as a record and there by deletion can be prevented. There is a new feature in SharePoint 2010 called In Place Records Management. This allows certain SharePoint documents (or blogs, wikis, web pages, and list items) to be declared records. The system can prevent such records from being deleted or edited.  For more details ...

Document Library Planning



Tuesday, April 1, 2014

Display a Sub-Site List on a Top Level Site


Edit the List/library on SharePoint Designer 2010 and open any of the view.
Select the list webpart and on ribbon under webpart tab, at save webpart section select "To File".
Save to your desktop.

Open the webpart page and upload it and add the webpart to the page. You are done...

http://www.wonderlaura.com/Lists/Posts/Post.aspx?ID=76

I like the above post for displaying subsite lists/libraries on parent sites..
But it did not work when I try to place the webpart on Wiki page, however it worked when I place the web part on a Webpart page.

Friday, March 7, 2014

Inserting/editing multiple items into SharePoint 2010 List at once


You cannot do if you go with traditional way of customizing SharePoint List with InfoPath 2010.

Instead you can insert multiple items into SharePoint List at once by creating the InfoPath Form from InfoPath form SharePoint List templates.

There is a very good article on this from Andrej... however, he did not explain how to edit multiple records at a time in InfoPath (other than editing in datasheet).

The requirement is I need to edit multiple records based on a parameter.
Any ideas would be appreciated on this...

Friday, February 14, 2014

Glossary/Index of products based on SharePoint Out Of Box Features


I need a very simple Glossary or Index of all the Product Items along with Images based on SharePoint out of box features. So I followed the below steps.


1. Create Image Library
1.1. Create a Glossary Image Library ( I Choose this as I can upload an image directly to this library where as if I choose a document library I cannot have preview, it just show an icon as Type, and with List, I have to upload the image to an image library and take the path of the image and add it as an image..)

1.2. Add the required columns like category, description, Intendedtouse, ProductType etc or use the existing columns if it suits for your requirement.

1.3. Create a View to show it on the page (with Preview or Thumbnail Preview).

1.4. Add this Image library to the page as List/Library webpart and change the View by editing the webpart.

2. Add Query String Filter Webpart to the page.
2.1 Edit the webpart, Query String Parameter Name = <a column from the list which should indexed>
then OK.
2.2. Query Sting Filter webpart --> dropdown @ right side of the webpart --> Connections --> Send Filter Values to --> Glossary (name of the web part that you already placed for the Image Library)
then (on popup) Coose Connection tab Connection Type: Get Filter Values From. On Configure Connection tab Consume Field Name: <choose the column which is used for index>
--> Finish

3. Now we need to add the alphabet list for indexes
3.1 Add a Content Editor Webpart and add the below content in HTML Editor and change the URL Paths and other content based on your requirement.
3.2. Save the page and refresh the page & test.

It should work perfectly...
Note: Make sure the query filter works correctly and html urls configured correctly for the alphabets.

==================== Content Editor HTML code
<!--DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"--><!--DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"--><style type="text/css" media="screen">
H3 {
FONT-SIZE: 130%
}
.container {
PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; BACKGROUND: #fff; PADDING-TOP: 0px
}
#minitabs {
BORDER-BOTTOM: #660099 1px solid; PADDING-BOTTOM: 20px; MARGIN: 0px; PADDING-LEFT: 10px; PADDING-RIGHT: 0px; PADDING-TOP: 0px
}
#minitabs LI {
PADDING-BOTTOM: 0px; LIST-STYLE-TYPE: none; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-TOP: 0px
}
#minitabs A:link {
PADDING-BOTTOM: 2px; LINE-HEIGHT: 14px; MARGIN: 0px 10px 4px; FLOAT: left; COLOR: #660099; FONT-SIZE: 10px; FONT-WEIGHT: bold; TEXT-DECORATION: underline
}
#minitabs A:visited {
PADDING-BOTTOM: 2px; LINE-HEIGHT: 14px; MARGIN: 0px 10px 4px; FLOAT: left; COLOR: #660099; FONT-SIZE: 10px; FONT-WEIGHT: bold; TEXT-DECORATION: underline
}
#minitabs A.active:link {
BORDER-BOTTOM: #696 4px solid; BORDER-LEFT: #696 4px solid; PADDING-BOTTOM: 2px; BACKGROUND: #fff; COLOR: #363; BORDER-TOP: #696 4px solid; BORDER-RIGHT: #696 4px solid
}
#minitabs A.active:visited {
BORDER-BOTTOM: #696 4px solid; BORDER-LEFT: #696 4px solid; PADDING-BOTTOM: 2px; BACKGROUND: #fff; COLOR: #363; BORDER-TOP: #696 4px solid; BORDER-RIGHT: #696 4px solid
}
#minitabs A:hover {
BORDER-BOTTOM: #696 4px solid; BORDER-LEFT: #696 4px solid; PADDING-BOTTOM: 2px; BACKGROUND: #fff; COLOR: #363; BORDER-TOP: #696 4px solid; BORDER-RIGHT: #696 4px solid
}
#miniflex {
BORDER-BOTTOM: #333 1px solid; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 10px; WIDTH: 75%; PADDING-RIGHT: 10px; FLOAT: left; FONT-SIZE: small; PADDING-TOP: 0px
}
#miniflex LI {
PADDING-BOTTOM: 0px; LIST-STYLE-TYPE: none; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; FLOAT: left; LIST-STYLE-IMAGE: none; PADDING-TOP: 0px
}
#miniflex A:link {
LINE-HEIGHT: 20px; MARGIN: 0px 10px; FLOAT: left; COLOR: #333; FONT-SIZE: 85%; FONT-WEIGHT: bold; TEXT-DECORATION: none
}
#miniflex A:visited {
LINE-HEIGHT: 20px; MARGIN: 0px 10px; FLOAT: left; COLOR: #333; FONT-SIZE: 85%; FONT-WEIGHT: bold; TEXT-DECORATION: none
}
#miniflex A.active:link {
BORDER-BOTTOM: #333 4px solid; PADDING-BOTTOM: 2px; COLOR: #333
}
#miniflex A.active:visited {
BORDER-BOTTOM: #333 4px solid; PADDING-BOTTOM: 2px; COLOR: #333
}
#miniflex A:hover {
BORDER-BOTTOM: #333 4px solid; PADDING-BOTTOM: 2px; COLOR: #333
}</style><div><table width="100%" class="s4-wpTopTable" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td valign="top"><div class="ms-WPBody noindex" webpartid="1f55372c-2b0b-4221-9d71-281e85b4e99c"><a href="/sites/abc/blogs/EFBlog/default.aspx" target="_blank"><table width="100%" class="ms-rteTable-6 ms-rteFontSize-2 ms-rteThemeForeColor-2-0 ms-rteBackColor-10" cellspacing="0" style="font-size: 1em"><tbody><tr class="ms-rteTableHeaderRow-6 ms-rteFontSize-2 ms-rteThemeForeColor-2-0 ms-rteBackColor-10"><th style="background-color: #60c; color: #ffffff"><span>Glossary</span> </th></tr></tbody></table></a></div></td></tr></tbody></table></div>
<div class="container"><table><tbody><tr><td style="width: 739px"><font color="#660099"></font></td></tr></tbody></table>
<ul id="minitabs" style="width: 1038px; height: 50px"><li><a href="/sites/abc/Pages/Glossary1.aspx">All</a> </li>
<li><a href="/sites/abc/Pages/Glossary1.aspx?Category=a">A</a> </li>
<li><a href="/sites/abc/Pages/Glossary1.aspx?Category=b">B</a> </li>
<li><a href="/sites/abc/Pages/Glossary1.aspx?Category=c">C</a> </li>
<li><a href="/sites/abc/Pages/Glossary1.aspx?Category=d">D</a> </li>
.... <li><a href="/sites/abc/Pages/Glossary1.aspx?Category=m">M</a> </li>
<li><a href="/sites/abc/Pages/Glossary1.aspx?Category=p">P</a> </li>
<li><a href="/sites/abc/Pages/Glossary1.aspx?Category=r">R</a> </li>
<li><a href="/sites/abc/Pages/Glossary1.aspx?Category=S">S</a> </li></ul>
</div>
=============================

Wednesday, January 22, 2014

Proc & Cons with SharePoint List vs External Data Sources & Data Sources - SQL Server vs Oracle


SharePoint Lists vs External Data Sources (BCS/External Lists)
1. BCS Limitations
http://chakkaradeep.com/index.php/bcs-limitations/

2. Using SharePoint workflows with Business Connectivity Services (BCS)
http://blogs.msdn.com/b/bcs/archive/2010/01/20/using-sharepoint-workflows-with-business-connectivity-services-bcs.aspx

Using SharePoint workflows with Business Connectivity Services (BCS) – Sandboxed Workflow Actions
http://blogs.msdn.com/b/bcs/archive/2010/01/29/using-sharepoint-workflows-with-business-connectivity-services-bcs-sandboxed-workflow-actions.aspx

Using SharePoint workflows with BCS – Full Trust Workflow Activities
http://blogs.msdn.com/b/bcs/archive/2010/03/02/using-sharepoint-workflows-with-bcs-full-trust-workflow-activities.aspx

3. http://blogs.msdn.com/b/chaks/archive/2011/05/02/concept-leverage-sharepoint-workflows-with-external-lists-part-1.aspx

Differences between native and external lists
http://office.microsoft.com/en-us/sharepoint-help/differences-between-native-and-external-lists-HA102771000.aspx

SharePoint Lists vs. External Databases
http://msdn.microsoft.com/en-us/library/ff798319.aspx




























Notes:
1. How to: Use Business Connectivity Services with SharePoint Workflows
http://msdn.microsoft.com/en-us/library/office/ff394479(v=office.14).aspx