Showing posts with label Quick Notes. Show all posts
Showing posts with label Quick Notes. Show all posts

Monday, March 19, 2012

Quick Notes: Retrieving Values in Event Receivers using BeforeProperties and AfterProperties

In SharePoint Portal development there are many scenarios where we need to develop event receivers.
So for accessing list item/ library item values, we need to use BeforeProperties and AfterProperties of SharePoint Event receivers. But some times they give empty or null values.
Below chart gives great understanding of which values are populated in BeforeProperties , AfterProperties and properties.ListItem objects.

For list:



List

BeforeProperties

properties.ListItem

AfterProperties

ItemAdding

Empty

Null

New Value

ItemAdded

Empty

New Value

New Value

ItemUpdating

Empty

Old Values

Updated Values

ItemUpdated

Empty

Updated Values

Updated Values

ItemDeleting

Empty

Original Values

Empty

ItemDeleted

Empty

Null

Empty

For library:


List

BeforeProperties

properties.ListItem

AfterProperties

ItemAdding

Empty

Null

Empty

ItemAdded

Empty

New Value

Empty

ItemUpdating

Old Values

Old Values

Updated Values

ItemUpdated

Old Values

Updated Values

Updated Values

ItemDeleting

Empty

Original Values

Empty

ItemDeleted

Empty

Null

Empty


The Synergy MOSS blog has explain this more clearly, please check here for more details.
Good Post on "SP 2010: How To – Event Receivers and Custom Error Pages" by Tobias Zimmergren . 
http://zimmergren.net/technical/sp-2010-how-to-event-receivers-and-custom-error-pages

Wednesday, February 29, 2012

Quick Notes: SharePoint Solution Deployment Commands - PowerShell

------------Add Snippet-------------------------
"C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\SharePoint.ps1"
Add-PSSnapin Microsoft.SharePoint.PowerShell
------------Add Solution-------------------------
Add-SPSolution "E:\SPSolutions\SharePoint. Finance.wsp"
Install-SPSolution –Identity SharePoint.Finance.wsp –WebApplication " http://SPServer:1000/" –GACDeployment -force
------------Update  Solution-------------------------
Update-SPSolution –Identity SharePoint.Finance.wsp –LiteralPath "E:\SPSolutions\SharePoint. Finance.wsp" –GacDeployment
------------Add Feature------------------------
Install-SPFeature Feature1 -force
Enable-SPFeature –Identity Feature1 –url "http://SPServer:1000/sites/Finance/"
------------Remove Feature------------------------
Uninstall-SPFeature Feature1
Disable-SPFeature –Identity Feature1 –url "http://spserver:1000/sites/Finance/"   

Microsoft has provided a tool to design PowerShell commands for SharePoint
Check this...
http://www.microsoft.com/resources/TechNet/en-us/Office/media/WindowsPowerShell/WindowsPowerShellCommandBuilder.html

Thursday, August 25, 2011

Quick Notes: How to Detect the Installed Edition of SharePoint 2010

Many times it is required to know the current edition of SharePoint 2010 installed.
If the behavior of your custom application depends on the installed SKU of Microsoft SharePoint Server 2010, you can determine which SKU of SharePoint Server 2010 is installed locally by using the Power shell command and GUID of SharePoint 2010 Editions.
In this topic I will explain the how to get current edition of SharePoint 2010.
1.      You can get GUID of installed SharePoint 2010 from registory within the registry key HKLM\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\WSS\InstalledProducts.
2.      Or You can also use the PowerShell command get-spfarm | select Products to output GUIDs for the installed SKUs.
3.      As you get the GUID then you can check it with following table.
SharePoint 2010 Edition
GUID
SharePoint Foundation 2010
BEED1F75-C398-4447-AEF1-E66E1F0DF91E
Search Server Express 2010
1328E89E-7EC8-4F7E-809E-7E945796E511
SharePoint Server 2010 Standard Trial
B2C0B444-3914-4ACB-A0B8-7CF50A8F7AA0
SharePoint Server 2010 Standard
3FDFBCC8-B3E4-4482-91FA-122C6432805C
SharePoint Server 2010 Enterprise Trial
88BED06D-8C6B-4E62-AB01-546D6005FE97
SharePoint Server 2010 Enterprise
D5595F62-449B-4061-B0B2-0CBAD410BB51
Search Server 2010 Trial
BC4C1C97-9013-4033-A0DD-9DC9E6D6C887
Search Server 2010
08460AA2-A176-442C-BDCA-26928704D80B
Project Server 2010 Trial
84902853-59F6-4B20-BC7C-DE4F419FEFAD
Project Server 2010
ED21638F-97FF-4A65-AD9B-6889B93065E2
Office Web Companions 2010
926E4E17-087B-47D1-8BD7-91A394BC6196

Monday, May 16, 2011

Quick Note: Quick Workflow Knowledge

SharePoint 2010 workflows can:
·         Automate common business steps
·         Help manage long-running processes
·         Route documents and forms
·         Collect feedback, approval, or notifications
·         Provide visual indicators of a process
SharePoint 2010 Standard and Enterprise include a selection of ‘out of the box’ workflows.  These tools help you automate the most common business tasks – sharing and collecting feedback on documents.  I see the following workflows used most often:
·         Approval Workflow - Routes the content for approval. You can setup this workflow as serial or parallel plus preset the approvers.
·         Collect Feedback Workflow - Routes the content for feedback. When the workflow completes all the feedback is sent to the originator of the workflow.
·         Collect Signature Workflow - Rather than just sending content for approval, this workflow requires digital signatures on the content.
‘Out of the Box’ Workflows
‘Out of the box’ workflows can be added to any SharePoint document library.  Simply select a template and pick a name.  Your workflow can start whenever a document is added, whenever a document is changed, or both.
Once your workflow is set up, it will auto-magically run when triggered.  Users may also start a workflow manually.
When the workflow starts, it will ask the user to set some rules.  Who should approve the document?  Is there a due date?  And my favorite!  Send a reminder e-mail if SharePoint doesn’t hear from an approver.
Workflows with Visio or SharePoint Designer
When your needs become more complex, SharePoint power users and developers can create custom workflows using drag-and-drop tools.  Workflows are composed of simple building block “activities” and conditional logic.  Workflows run based on events and conditions affecting a document or SharePoint list item.
If you are comfortable with Visio, you can use familiar tools to snap together a SharePoint workflow. Various workflow actions are available, such as Assign Task, Send E-mail, Create List Item, Collect Data from User, Wait for Timer, and more.

Last but, Very Powerful way to implement the workflow is to develop it in Visual Studio (Custom Code).
Workflows can be used to manage projects, track engineering change orders, manage customer service, route mortgage documents, automate human resource tasks – even starting a bidding war between vendors during an RFP process.
Were you timing me?  In just a few minutes I’ve explained how simple – yet powerful – workflows can help you automate your business processes.  Workflows can be designed to improve almost any aspect of your business.  

SharePoint 2010 Document Management

Quick Note: Understanding the Relationship Between Taxonomy, Metadata and Content Types

Content Classification consists of three primary elements; a Taxonomy, Metadata, and Content Types.  Taxonomy is a hierarchical classification of terms. Metadata (Site Column or Field) is “data about data” in that it provides context to content, while a Content Type is a collection of Metadata.
The values in a Metadata field could be populated by Taxonomy terms. It is a common misconception that Taxonomy is comprised of Metadata, when in fact it is comprised of Metadata attributes commonly referred to as terms. These attributes are typically used as values in a Metadata field. Example: A Metadata field is named “Department” where the possible values for the “Department” field from the Taxonomy are “Sales”, “IT” and “HR”. The Content Type is named “Proposal” and includes Metadata fields for “Proposal Title”, “Department” and “Proposal Date”.

Thursday, May 5, 2011

Quick Note: Office 365 Developer Training Kit available

It’s great news for all SharePoint Developers! Microsoft also announced the “Office 365 Developer Training Kit“.
With the release of this training kit, developers have a great starting point for customizing Office 365.
Guidance that provides developers with advanced guidance on how to develop for Office 365 including SharePoint Online, Exchange Online and Lync Online
 Besides the offline version, there is also an online version named “Office 365 Developer Training Course“.

Links:

1. SharePoint Online Developer Resource Center
2. SharePoint Online: An Overview for Developers