Monday, June 13, 2011

SharePoint 2010 - Set default value for a lookup column using InfoPath and no code

If you have a look up column in your SharePoint 2010 list and want to assign a default value while adding an item (insert mode) then this post is relevant for you. Read on.

What you need to know before proceeding further:
1) You need to have InfoPath installed on your machine.
2) You need to know how you can use infopath to create custom forms for adding or editing items in the list.

See this video on how to Customize a SharePoint List Form using InfoPath 2010


Follow these steps:
1) Go to the SharePoint list and click on Customize form(under the List tab)


2) Clicking on "Customize form" will open up the InfoPath with list items (uses default page layout).

3) Click on the lookup field from the Fields list and then properties. Set the default value of the field in the default value section.



4) Make sure you have at least one item in your lookup list.

5) Enter a value in the default value text box (numeric id not text) of the default value section and click OK.

6) Publish the InfoPath by clicking on the quick publish button (on the top left corner beside save button).

You are done. You should be able to see the default value when you try to add an item to the SharePoint list.

Wednesday, June 1, 2011

Sharepoint 2010 error while deploying solution - This solution contains no resources scoped for a web application

Error:
This solution contains no resources scoped for a web application and cannot be deployed to a particular web application

Fix that worked for me:
stsadm and powershell commands were giving me the above error and I went to central admin site and manually deployed the solution.
Go to Central Admin -> System Settings -> Farm Management -> Manage Farm solutions -> Select the solution you want to deploy and finally deploy