Welcome to my personal blog, All the information in this bogs is my ideas,findings and thoughts on .Net, Asp.Net and SharePoint.
ALL POSTING ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND
Browse by Tags
-
Some scenarios developers may want to restrict users from deleting webparts from a page, the scenarios varies. SPWebPartManager has got a event named ‘OnWebPartDeleting’.The issue here is, the deletion of the webpart cannot be avoided by setting the WebPartCancelEventArgs.Cancel Read More...
|
-
When you develop a custom field type that inherits from SPFieldLookUp/SPFieldUser(not sure about any other controls) . The derived field type has its own rendering controls. The issue arises when multiple values are to be stored in a field of the custom Read More...
|
-
I encountered an issue when assigning a multi-user data to a workflow task field from within the workfflow. There may be various reasons anyone wants to create a User/Group field with multiple values and set it within in the workflow as below, SPWorkflowTaskProperties.ExtendedProperties["CustomAssignToUsers"] Read More...
|
-
The max number of characters that can be passed through FullTextSqlQuery is 4096 characters, beyond this length throws an exception ArgumentOutOfRangeException. You will get the same behavior when using the webservice QueryEx(XmlNode) as well. 1: private Read More...
|
-
1: namespace MyNewProfileHandler 2: { 3: public class MyUserProfileHandler : MySiteProfileHandler 4: { 5: public override void SetMySiteOwner(Microsoft.Office.Server.ServerContext context, UserProfile profile, string newOwner) 6: { 7: base .SetMySiteOwner(context, Read More...
|
-
Removing Association 1: SPSite site = new SPSite( "http://localhost" ); 2: SPWeb web = site.OpenWeb(); 3: SPList list = web.Lists[ "Shared Documents" ]; 4: SPWorkflowAssociation _association = null ; 5: foreach (SPWorkflowAssociation association in list.WorkflowAssociations) Read More...
|
-
1: SPSite spSite = new SPSite( "http://localhost" ); 2: SPWeb spWeb = spSite.OpenWeb(); 3: SPList spList = spWeb.Lists[ "Shared Documents" ]; 4: SPList workflowlist = spWeb.Lists[ "NewHistoryLibary" ]; 5: SPWorkflowAssociation association = spList.WorkflowAssociations[0]; Read More...
|
-
You might have experienced a road block when trying to the update the ‘ ModerationStatus’ field with other fields. Any attempt to do so will result in an exception “ You cannot change moderation status and set other item properties at that same time ”. Read More...
|
-
Here is the scenario, you may want to get an object(SPListItem) without iterating through the list item collection, if you know the URL of the file the GetObject() returns the item. Section#1 1: 1. SPSite site = new SPSite( "http://nishand:100/sites/RootSite/" Read More...
|
-
1: SPSite spSite = new SPSite( "http://nishand:100/sites/InternetSite/" ); 2: SPRecycleBinItemCollection collection = spSite.RecycleBin; 3: 4: for ( int x = 0; x < collection.Count ; x++) 5: { 6: collection[x].Delete(); x = x-1; 7: } 8: The above code Read More...
|
-
When we set SPWeb.ParserEnabled to false, it disables the document parser (there will not be any property demotion and promotion), it means that the file properties and the WSS properties will not be in sync. So when you search for a custom file property Read More...
|
-
By default the SPWorkflowAssociation.AutoCleanupDays property value is set to ‘60’ days, to set this property we need to call the SPList.UpdateWorkflowAssociation(SPWorkflowAssociation) function, SPWeb.Update() won’t work here. 1: SPSite site = new SPSite( Read More...
|
-
When we create a site either through UI or OM, it will not come as a tab unless you check the option ‘ Sit e Actions-->Site Setting-->Navigation-->Show subsites to true’. On checking the option results in displaying all the subsites as ‘Tabs’. Read More...
|
-
Note: Make sure that you have enabled search based alerts SSP-> Search Settings -> Search Based Alerts 1: SPSite spSite = new SPSite( "http://nishand:300/sites/PubSite/Search/" ); 2: SPWeb web = spSite.OpenWeb(); 3: Query alertQuery = new KeywordQuery(spSite); Read More...
|
-
1: SPSite site = null ; 2: SPWeb web = null ; 3: site = new SPSite( "http://server:100/sites/DevSite/" ); 4: web = site.OpenWeb(); 5: SPRoleAssignment roleAssignment = new SPRoleAssignment( "domain\\user" , "alias@domain.com" , "Nishand" , "Simple Test Read More...
|