Pages

Thursday 9 April 2015

List and Library interview questions

  1.  Difference between list and library?
  2.  New features introduced in sp2010 on Lists and Libraries compared to SP2007?
  3. List throttling?
  4. External List throttling?
  5. Column level validations?
  6. How to show the documents that were created by the current user only?
  7. Update a SharePoint list item without changes its version?
  8. Difference between Update and systemupdate in SharePoint list?
  9. What is the default size of upload document in SharePoint?
  10. How to upload large size of documents to document library in SharePoint?
  11. Document Library name and sub site name cannot be the same. Why?
  12. Check in and checked out documents in SharePoint?
  13. How to make document changes Offline?
  14. How to check in all the checked out documents at once?
visit the SharePoint Interview Questions and Answers: List vs Library2:

1. Difference between list and library?
List means: A list contains items that are collections of fields/properties/columns. Optionally each item can have one or more attachments.
Library means: A library is a list, but has one and exactly one file associated with each item. A library item also has fields/properties/columns.
Simple way to say this is that a list item has a focus on "text" stored in fields/properties/columns, while a library has a focus on a single document.
Checking option: SharePoint list doesn’t support check in and check out options but SharePoint Library supports.
Search: When the user searches for a keyword in a document, if the document is in a list then search returns the list item as the result. When the user searches for a keyword in a document, if the document is in a library then they find the document listed in the search results.
List examples: Contact lists, Task lists etc.
Library examples: Picture library, Form library etc.

2. New features introduced in sp2010 on Lists and Libraries compared to SP2007?
  • Column validation.
  • Enforce unique values
  • Customize the form using InfoPath
  • New/ updated column Types:
    • Lookup fields.
    • Managed metadata.
  • View:
    • Inline editing.
    • Views by location.
3. List throttling:
4. External list throttling:
5. Column validation supports:
  • Single Line of Text
  • Choice (single only)
  • Number
  • Currency
  • Date & Time
6. Column validation rules:
A validation formula at the column level cannot include any other columns besides itself. For example, [Column1]> [Column2] is an invalid formula and SharePoint will not allow it to be used at the column level. In this case, you want to use list-level validation.
Column validation will not support to validate even Today function also. For example: [Column1]> [Today]. 
7. How to validate at list level and field level in SharePoint?
8. How to do validation if the field values don’t allow more than 8?
Formula = LEN ([REGION]) <8.
How to do validate if Due date is not greater than equal to current date [means disallow the Due date that is in past]?
Enter the [Due Date] > Today () formulae in column validation while creating the “Due Date” field.
9. What if you have both column level validation and list level validation? 
The column level formulas will be evaluated first, then the list formulas.
10. What if the column and list level validations are in conflict?
Best ref: http://digsharepoint.blogspot.in/2011/06/sharepoint-2010-column-validation.html

11. How to show the documents that were created by the current user only?

You can do this using the user interface by specifying that the Created By field needed to be equal to [Me].

Comparison of CAML and LINQ in SharePoint 2010


Comparison of CAML and LINQ in SharePoint 2010

Disadvantages of CAML:
  • CAML query is text based so, if we are joining two lists across a lookup field there may be various problems associated with that.
  • CAML offers no compile time validation for the queries as queries are just
    strings that are used with objects like SPQuery, which means that during
    compile your query will never be checked for syntax errors. Furthermore, if
    your syntax is not correct you won’t get an error during runtime, the query
    just won’t return any items. That makes it extremely hard to analyze issues
    caused by faulty CAML-based queries.
  • There is no mechanism to know until run time if the query is written correctly or not. If the query is not correct, then it will simply fail at run time. Means it won’t support at design time
  • When writing the query, you have no idea what CAML elements are legal in the syntax without having a reference open.
  • The query is somewhat difficult to understand. We cannot determine easily what the query is doing and what lists are being joined.
  • The data returned from the query is placed in a SPListItem collection, which does not provide strongly typed business entities.
 Advantages of LINQ over CAML:
  • First advantage is, it is an object-oriented query language.
  • Linq stands for Linera Integrated Query. LINQ adds syntax of type SQL and vocabulary, which is used to query the data from data source. LINQ to sharepoint is defined inMicrosoft.SharePoint.Linq namespace. It translates the LINQ query into CAML (Collaborative Markup Language).
  • It can provide strongly typed objects at design time; we can create queries in code and can check that they are correct because we can the compiles the code.
  • The results are returned from queries are strongly typed objects, so the items and fields can provide compile-time checking.

Disadvantages of Using LINQ
  • ·          LINQ translates the LINQ queries into Collaborative Application Markup Language (CAML) queries thus adding an extra step for retrieving the items.
  • ow some of you may think that how CAML or LINQ queries are able to fetch the data from a list. So, below steps will clear your confusion about CAML and LINQ queries:
    • LINQ queries are converted to CAML queries.
    • CAML queries are also translated into SQL queries.