Welcome

Sharepoint lead is a place where you can read about interesting topics related to sharepoint, and you can also post comments and suggessions.

Wednesday, July 4, 2012

Not able to change page layout


Problem:​
Due to some problem in page, Page Layout button in ribbon is showing disabled.
Solution:
Use following as QUICK solution if you are creating a new page:
  1. Delete newly created page
  2. Go to site settings > Page Layouts and Templates
  3. Locate "New page defualt settings" and select the page layout that you want to set as default page layout.
  4. Save setting
  5. Create new page
There can be many reasons of Page Laout showing disabled in ribbon. You can reference following links to go deeper and resolve it properly.
  1. Try check out the page and then go to edit mode of the page.
  2. Try different browsers to change page layout
  3. ​Change page layout using powershell
  4. Reference link 1​

Monday, July 2, 2012

SMTP4DEV: Your sharepoint 2010 out going email server for development farm

If you are having standalone sharepoint 2010 development farm on window7 64bit, and looking for good option,  SMTP4DEV. It is a free tool. You will need around 10mins and then you can start receiving emails from sharepoint farm! Here are quick steps:

  1. Download  SMTP4DEV from it's codeplex project site, I prefer standalone exe but you can download installer as well.
  2. If you like to use some custom local domain, click on options and set up some local domain like local.machinename.com. Create host entry pointing to 127.0.0.1
  3. By completing these many steps you can now send emails through  SMTP4DEV by any url ending in @local.machinename.com
  4. Go to sharepoint central administration > System settings > setup outgoing email server.
  5. set local.machinename.com as server, and provide any email ending in @local.machinename.com 
  6. Save your settings
After these minimum set of configuration you will be able to start sending emails. Beauty of SMTP4DEV is:
  1. It will show you notification that new email is sent
  2. It will show you all emails sent from the smtp in UI without actually sending it
  3. You can inspect email
  4. You can view email (in email client that you set default)
So, in conclusion, it is a best choice KISS kind of solution for your sharepoint 2010 development farm's outgoing SMTP server.




Sharepoint 2010: TryGetList vs GetList

As a developer, you will say GetList can throw exception but TryGetList will not. It is actually confusing because TryGetList looks for listTitle and returns null if list is not available at expected location. GetList will expect listUrl and can throw FileNotFoundException or ArgumentException if list is not present at expected location or relative/absolute url of list is invalid relatively. Another biggest difference is they belong to different class!


Apart from all those technical details, I noticed that many sharepoint administrators likes to start with a simple list/library name and eventually change it to make it as close as possible to what they do. That will make list/library url and their names different. Here comes the actual problem. If you are actually using list/library names in your code, it will no longer work. OR we can say you are not allowing sharepoint administrators to change name of list/library that they have created. 


By using GetList you are actually giving them flexibility to use whatever name they like to use, as far as they are not changing url or list/library code will still work.


In conclusion, it really depends on requirements how you are going to deal with the situation but it is good to keep in mind that you can use GetUrl function in your code to allow sharepoint administrators to change their names without worrying about breaking functionality.







Friday, June 22, 2012

How to use soapUI to review ListData.svc


Introduction

​SoapUI is a free tool that can be used to test out of the box ListData.svc service provided by sharepoint. This service is available at /_vti_bin/ListData.svc for any of your sharepoint site. Here is how we can try it out using SoapUI.

Step 1: Install sopa UI and click on File > New SoapUI Project. Add some project name and check "Add REST Seervice:" like shown in following figure and then click OK



Step 2: After clicking on OK another window will open like following, just click on OK




Step3: New REST resource window will appear. In resource name enter site url and in resource path/endpoint provide list/document library name and click on "Extract params" button. Following is the screen that shows sample data.




Step4:That will automatically create a new request called Request 1.This request will automaticlaly detect endpoint and path to your list/document library. If it is not, just click on"-no endpoint set-" and click on add new endpoint. Enter site url in the dialog again.



Step5: Maximize "Request 1" window in soapUI. In botton left corner you will see " ... ", click on it and you will be able to provide sharepoint authentication details there.



Step6: Once you are done with authentication details you can click on execute icon at top left corner of "request 1" window (marked in above figure) to execute the request and you will be able to see response at right hand side window.

Step7: ListData.svc can also return json data in response out of the box. Just try to provide accept = application/json like shown in figure below:


Conclution:
SoapUI is a super simple too to try out and it will be really help to review xml/json data while you are planninig to consume it with jQuery.