Actually using object model we can’t set the default scope of Calendar view. Let’s see how the SharePoint UI do it and then try to replicate the same in our solution. When you change default scope of calendar view through UI, SharePoint sends RPC request to _vti_bin/owssvr.dll. To see what RPC request SP sends, let’s modify the default scope through sharepoint UI and check the […]
The best way to retrieve results from sharepoint list in terms of performance using client object model is to use ‘include’ with lambda expression. using (var context = newClientContext(http://server/site/sitecollection)) { List currentList = context.Site.RootWeb.Lists.GetByTitle(“MyList”); CamlQuery camlQuery = newCamlQuery(); camlQuery.ViewXml =“[YourViewXmlhere]”; ListItemCollection collListItem = currentList.GetItems(camlQuery); context.Load(collListItem, items => items.Include(item => item[“ID”], item => item[“SomeField1”], item => item[“SomeField2”])); […]
Feature stapling allows you to associate a set of SharePoint features with any site definition. Therefore, whenever any site collection is provisioned from that site definition, the features associated with it gets activated automatically. Lets go ahead and see how to apply feature stapling. For this demo, I would staple these 2 OOB sharepoint features with Team Site (Site […]
Just follow these steps to enable anonymous access to your sharepoint 2010 site. Step 1 Open SharePoint Central Adminsitration. Under Application management tab, Click on Web Application management. Step 2 Choose your web application and click on ‘Authentication Providers’ link on the ribbon. Step 3 Under ‘Zone’, Click on ‘Default’. Step 4 Tick ‘Enable […]
Before we start creating a custom Web template, I think it’s important to understand do we really need to create one? Even though web templates are easy to create and maintain as compared to site definitions, I would not recommend web templates simply because of the fact that they gets stored in content database. Thus, there is always an […]
There is this very common requirement to prepopulate sharepoint people picker field with logged in user name in New and Edit forms of sharepoint list. Below is something one can consider to achieve this – Using Sharepoint designer, add the following javascript code in Newform.aspx or EditForm.aspx to Pre-populate the logged in user as a default in sharepoint people picker […]
To send email to multiple users, stored in multi-user people picker field, using sharepoint designer 2007, one needs to play a little trick. Please do as follows: 1) Create a variable , create a new action of type Build Dynamic string: Click on “Actions” and choose “Build Dynamic string”. Click on “Dynamic string”, this will open a new multiline textbox. Click on Add […]
Recently, I got tangled with this “The remote server returned an error: (502) Bad gateway” problem when my custom webservice, which is using SP Client object model, failed to access sharepoint list. To troubleshoot this issue, I tried to login to the sharepoint site from the remote server using the same credentials under which my […]
Recently, I came across a scenario where I had to hit sharepoint using client object model to query data from the entire site collection. Most of you must be aware that Client object model doesn’t provide an API that can query data from all the lists in a site collection. Therefore, I had to create a WCF service in Sharepoint which used […]