February 29, 2012

Interview Questions

What are features of SharePoint 2010?
Ans Some features are :
· Document Collaboration
· Enterprise Search FAST Search
· New Enhance Web Part
· Ready made Silver Light web part
· Business Connectivity Services
· Social Media Investments
· Large lists
· Enhanced collaboration features
· Visio Services
· Usage reporting and logging
· Better Network Differencing & SharePoint Offline in SharePoint Workspace
· High Availability/ Disaster Recovery Innovation
· Admin Insights through the Logging & Usage database, and dev dashboard
· Service Applications
· SharePoint Designer Enhancements like portable workflows, and granular delegation
· Sandbox Solutions

Q What is WSS ?
Ans Windows SharePoint Services (WSS) is a Web portal used for collaboration within a business or organization. WSS is easily accessible through an Internet browser such as Internet Explorer. SharePoint is a hosted application - which means in order to use it to full potential, it must be hosted on a Windows server.

WSS provides a solid base to set up one or more intranet sites.
The main WSS features are:

Unlimited number of team sites or portals

Document management with collaboration and sharing capabilities (Check-in/Check-

out, workflow, meta-data, 'warn me', discussions...)

Task management and calendars on group level

Central notification management (problems, complaints, help desk...)

Collecting information/surveys via question forms

Extended search engine within each site

Workflow (examples: expense reports, holiday administration...)


Digital dashboards, with or without scorecarding

Q What is MOSS?
Ans MOSS stands for Microsft Office Share Point Server. MOSS is a portal based platform for complete management of documents & web services. It is a platform for creation of customized web based applications & portals like blogs, wiki etc. MOSS provides security features and can be configured to return separate content based on the fact that the user has logged on using internet, intranet or extranet.

MOSS provides extra features as compared with WSS

Consolidation of all the team sites within the organization

Enterprise search : search through different sources within the organization with one

interface (portals, mail, ERP, CRM ...)

Central personnel data base with extended search capabilities, linked (or not) to

internal personnel management.

Business Data Catalog (BDC): default link to external systems (e.g. CRM/ERP)

Report Center : central management of all reports and data connections.

Excel Services : provides Excel features in the web browser.

Creation of web-based e-Forms, full web-browser access.

Q Difference between Library vs List ?
Ans Library is used to store the document and Lists are the container of similar items in form of rows and columns. In Library you can create core document like Word, Excel, PowerPoint. But in List You can not create document, instead of that you can attach document in a particular List.

Q What is difference between Document Library and Form Library?
Ans Document Library contains core document such as , MS word, Excel, Powerpoint. But Form library contains document in XML form. Such as InfoPath form.


Q What is Central Admin in SharePoint?
Ans Central admin is the default website by sharepoint while installing.


Q What is stsadm command?
Ans Stsadm command is used to perform all administrative work. For e.g. backup, restore, installing feature, adding web part to site etc.


Q What is the command to take backup and restore for sharepoint site?
Ans Backup command:

stsadm -o backup -url http://moss:4002/ -filename c:\bkupsite.bak

To restore :

stsadm -o restore -url http://moss:4004/ -filename c:\bkupsite.bak

Q What is a Farm?
Ans n the context of SharePoint, the term ‘farm’ is used to describe a collection of one or more SharePoint servers and one or more SQL servers that come together to provide a set of basic SharePoint services bound together by a single Configuration Database in SQL.

Farms can range in size from having everything (all SharePoint roles and SQL server) on one machine to scaling out every individual SharePoint serve role onto dedicated sets of servers. A farm the highest administrative boundary for SharePoint and everything that happens inside SharePoint happens in a farm.

In Short : A sharepoint Farm is a collection of one or more sharepoint server which having a single configuration database.

Q What are sites available in SharePoint?
Ans
Team Site
Blank Site
Document Workspace
Blog
Group Work Site
Visio Process Repository
Basic Meeting Workspace
Blank Meeting Workspace
Decision Meeting Workspace
Social Meeting Workspace
Multipage Meeting Workspace
Assets Web Database
Charitable Contributions Web Database
Contacts Web Database
Issues Web Database
Projects Web Database
Document Center
Records Center
Business Intelligence Center
My Site Host
Personalization Site
Enterprise Search Center
Basic Search Center
FAST Search Center
Enterprise Wiki
Publishing Portal
Publishing Site
Publishing Site With Workflow
Central Administration

Q. What is a site definition in sharepoint?
Ans Site definition is a combination of template and XML. Site definition available in sharepoint are STS for Team and Blank Site, MPS for ,meeting workspace. BLOGS for Blogs site.

Q. What are SharePoint object model?
Ans. In Sharepoint Object model there are two Important namespaces.

The Microsoft.Office.Server namespace is the root namespace of all Office Server objects and Microsoft.SharePoint is the root namespace for all WSS objects.


Q. What is a site collection?
Ans. Site Collection is collection of sharepoint site. i.e. Sharepoint site collection is logical grouping of multiple sharepoint site.
A site collection is a group of Web sites that have the same owner and share administration settings, for example, permissions. When you create a site collection, a top-level site is automatically created in the site collection. You can then create one or more subsites below the top-level site.

A site collection must exist within a Web application. You can create a site collection based on an existing Web application, or you can create a Web application and then create a site collection within that application.

Q. What is a site?
Ans.
Site is a collection of web pages which is used to store information in organised way.
Site stores list of documents, discussion, events, task and many other types of information.
Site provides controlled access to share information among user. i.e. Only Authorize users are allowed to access shared information.


Q. What are web Parts in Sharepoint?
Ans Web Parts are the fundamental building blocks for Share Point user interface, and with them we can build and integrate many different types of applications.

Webparts are smallest component in sharepoint. Web parts are used to give more functionality to the page. In sharepoint we have custom web part as well as ready made 3rd party web part. You can create a custom web part by using visual studio

Various web parts available in sharepoint web part gallery are:

Data view web part, Content editor web part, Form web part, Excel web access web part, Image web part etc.


Q. What is web application in Sharepoint?
Ans. In sharepoint Webapplication is a IIS website. Each web application is associated with one IIS website. For each web application, content database is created.


Q. What is CAML?
Ans. CAML stands for Collaborative application markup languages. It is in xml form. And it can be sued to retrieve the data from sharepoint list as well to update and insert.


Q. What are Content types?
Ans. A content type is a reusable thing provided by WSS. content type defines the column for an item in a library or list and same can be used for any library or list in that sharepoint application.

For e.g. you are creating a list for leave application then if you are creating column for HR department, IT department then it does not makes any sense.

So used content type where you can create your own column or site column (Given by sharepoint) and you can use this content type with any list or library.

Q. What is BDC?
Ans. BDC i.e. Business Data Catalouge. It is a middleware for your sharepoint site and back end data such as SAP, Siebel and any other Line of Business application.

In BDC you can not modify data from your sharepoint list. It will be available to your site in read only.

In Sharepoint 2010 it is named as BCS (Business Connectivity Services). BCS is two way, i.e. Data can be edit from sharepoint list as well from the back end data base.


Q. What is workspace?
Ans. A site or workspace is when you want a new place for collaborating on Web pages, lists and document libraries. For example, you might create a site to manage a new team or project,collaborate on a document or prepare for a meeting.


Q. Workflow can be applied to what all elements of SharePoint ?
Ans.
While workflow associations are often created directly on lists and document libraries, a workflow association can also be created on a content type that exists within the Content Type Gallery for the current site or content types defined within a list.

In short, it can be applied ...

At the level of a list (or document library)

At the level of a content type defined at site scope

At the level of a site ( Sharepoint 2010 )


Q. What are the ways to initiate the workflow ?
Ans.Automatic (on item added or item deleted)

Manual (standard WSS UI interface)

Manual (Custom UI Interface)

Programatically through custom code


Q. What are the types of input forms that can be created for a workflow ?
Ans.
You can create four different types of input forms including an association form, an initiation form, a modification form, and a task edit form. Note that these forms are optional when you create a workflow template.

Q. What are ways to create input forms for workflow ?
Ans.Two different approaches can be used to develop custom input forms for a WSS workflow template.

You can create your forms by using custom application pages, which are standard .aspx pages deployed to run out of the _layouts directory. ( disadv: lot of code required when compared to Infopath approach)

using Microsoft Office InfoPath 2007 /2010 (disadv: picks up a dependenct on MOSS, i.e. it cannot run in a standalone WSS environment)



Q. What is the difference between method activity and event activity in WF ?
Ans A method activity is one that performs an action, such as creating or updating a task. An event activity is one that runs in response to an action occurring.


Q. What is different with SharePoint 2010 workflows ?
Ans. Some of the additions in workflow model are :

1. SharePoint 2010 workflows are build upon the the workflow engine provide .Net Framework 3.5.

2. In addition to the SharePoint lists we can now create workflows for SharePoint sites as well.

3. SharePoint Designer 2010 also has a new graphical workflow designer for designing workflows and deploying them directly to SharePoint.

4. Another Improvement in SharePoint Designer 2010 is that it now allows you to edit the out-of-the-box workflows that come with SharePoint.

Q. What is the difference between an Internet and an intranet site?
Ans. An internet site is a normal site that anyone on the internet can access (e.g., www.msn.com, www.microsoft.com, etc.). You can set up a site for your company that can be accessed by anyone without any user name and password.

An intranet (or internal network), though hosted on the Web, can only be accessed by people who are members of the network. They need to have a login and password that was assigned to them when they were added to the site by the site administrator

Q. What are the various kinds of roles the users can have?
Ans.
A user can be assigned one of the following roles

Reader - Has read-only access to the Web site.

Contributor - Can add content to existing document libraries and lists.

Web Designer - Can create lists and document libraries and customize pages in the Web site.

Administrator - Has full control of the Web site.

Q. What are the types of authentication available for Sharepoint 2010 ?
Ans.Claims

Windows

Forms-based authentication

Q.What is claims based authentication ?
Ans.Claims is a new authentication method that SharePoint 2010 can utilize. This allows a single authentication store for multiple types of authentication (Windows NTLM, SQL FBA, LDAP, etc) which allows all of these types of authentication to access SharePoint under a single URL.

Claims creates a SAML token based on the sign-in, that contains the user’s identity.
Ref: http://blogs.technet.com/ritaylor/archive/2009/06/03/claims-based-authentication-an-overview.aspx


Q. How do we use the claims identity outside of SharePoint?
Ans.LOB systems

External partner services

Separate SharePoint farms

Q. What is LINQ to Sharepoint ?
Ans.
LINQ is a feature of the programming languages C# 3.0 and Visual Basic .NET

LINQ adds, to each of the languages, a SQL-like syntax and vocabulary for querying data sources.

LINQ to Sharepoint allows developers to use SQL-like syntax to query Lists and Libraries in Sharepoint.

LINQ to Sharepoint internally converts the LINQ query to a CAML query to fetch records

Advantage : Strongly typed access to the entities of the list.

Disadvantage : If the new columns are added or its datatype changed, the datacontext class used by LINQ is no longer valid and may break the code


Q. Name the tool used to create DataContent classes for use in LINQ queries?
Ans.SPMetal.exe

Q. What are the advantages and disadvantages of LINQ to Sharepoint ?
Ans.
Advantages:

Intellisense

Strongly typed access to the entities of the list

Faster development

Simplify complex queries

Disadvantages:

If the new columns are added or its datatype changed, the datacontext class used by LINQ is no longer valid and may break the code

Extra layer to the actual CAML query


Q. Can MS Visio be used to create a Sharepoint workflow ?
Ans.
MS Visio cannot be used to create the Sharepoint workflow itself, but can be used for workflow visualization. What this means is that, the flow diagram designed in Visio can be imported in Sharepoint Designer where all the functionality can be added and deployed to Sharepoint.

Note:

To use Visio 2010 for workflow visualization, you must be running the Enterprise version of SharePoint Server 2010 and Visio 2010 Premium.

Q.Whats new in Shared Service Provider (SSP ) in Sharepoint 2010 ?
Ans.
“Service Application” or “Service App” is a concept in Sharepoint 2010, where SSP Services are split out into separate services.

What is replaced :

Profiles, Audiences = People Service App

Search = Search Service App

Excel = Excel Service App

Whats new :

Project Server = Project Server App

Visio Services = Visio Service App



Advantages :

Web applications can be configured to only use a subset of the deployed services.

You can deploy multiple instances of the same service in a farm by giving the new service instances unique names.

You can share services across multiple web applications in a farm.

Ref :

http://blogs.msdn.com/uksharepoint/archive/2009/10/21/sharepoint-2010-new-shared-services.aspx

http://aknauer.blogspot.com/2009/11/sharepoint-2010-advantages-of-service.html

http://www.andrewconnell.com/blog/archive/2009/10/19/the-new-service-application-architecture-in-sharepoint-server-2010.aspx

http://www.andrewmilsark.com/blog/post/2009/10/20/SharePoint-2010-Service-Applications-(Shared-Services)-Overview.aspx



Q. Explain types of SharePoint Sites
Ans. Types of sharepoint sites:


Wiki: This is usually where everyone is allowed to add/change content for a common knowledgebase.

Blog: This type of site is for posting specialized articles or information for everyone to read.

Publishing site: This site is used to approving particular content before it’s published to everyone.

Document library: A site mainly used for document management purposes.

Download site: This type of site helps in monitoring the count of downloads and track them.

List or Forum: The idea is to have specific people post a topic and then allow others to comment on the posts.


Survey: Usually a site that’s accessed by everyone for conducting a survey.

Dashboard: The idea of a dashboard is for business executives to gain information and perform reporting tasks.


Q. What is SharePoint Workflow? Explain its purposes
Ans. Workflows are implementation of business processes allowing people to collaborate on documents through various project tasks assigned to individuals. They enhance productivity and organization of work in an organization. This enables people to only concentrate on tasks given to them. It’s basically a planned series of tasks assigned to individuals to achieve an outcome.

Workflows included in MOSS:

Approval

Collect Feedback

Collect signatures

Disposition approval

Three-state

Group approval

Translation management

Overall MOSS workflows target at higher productivity keeping collaboration and business processes in mind.


Q. How is SharePoint Portal Server different from the Site Server?
Ans. The Sharepoint Site Server has search capabilities which are more advanced using SharePoint. It uses digital dashboard technology, which provides a nice interface for creating web parts and also allows showing them on dashboards pages. Site Server on the other hand, does not have anything as advanced as that. The biggest difference would be Sharepoint Portal Server’s document management features which also integrate with web folders and MS Office.

Q. What are ways to create input forms for workflow?
Ans. MOSS has the capability for a workflow participant to fill an initiation form to start a workflow. The initiation form can have fields that support:

Single line of text

Multiple lines of text

Number (up/down counter arrows)

Yes/No (Checkbox)

Choice (dropdowns)

Date and time (calendar)

One can use these to create forms by using custom application pages (aspx pages), which are deployed to run out of the _layout directory on MOSS server or using Microsoft Office Infopath 2007 /2010


Q. What is an application pool?
Ans. A group of one or more URLs that are served by a particular worker process or set of worker processes.


Q. Why are application pools important?
Ans. They provide a way for multiple sites to run on the same server but still have their own worker processes and identity.


Q. What are zones?
Ans. Different logical paths (URLs meaning) of gaining access to the same SharePoint Web application.


Q. What are Web Application Policies?
Ans. Enables security policy for users at the Web application level, rather than at the site collection or site level. Importantly, they override all other security settings.

Q. What are content databases?
Ans. A content database can hold all the content for one or more site collections.


Q. What are My Sites?
Ans. Specialized SharePoint sites personalized and targeted for each user.




Q. What is the difference between Classic mode authentication and Claims-based authentication?
Ans. As the name implies, classic authentication supports NT authentication types like Kerberos, NTLM, Basic, Digest, and anonymous. Claims based authentication uses claims identities against a against a trusted identity provider.

Q. When would you use claims, and when would you use classic?
Ans. Classic is more commonly seen in upgraded 2007 environments whereas claims are the recommended path for new deployments.


Q.What is webpart?

Ans:Web parts consist of xml queries to full SharePoint lists or document libraries. You can also develop your own web parts and web part pages.

Q.What are the types of input forms that can be craeted for a workflow
Ans:1. An association form
2. An initiation form
3. A modification form
4. A task edit form.

Infopath 2010

Here are 10 nice tips designed for someone that's familiar with SharePoint, but may be new to InfoPath.
Having brooded over the idea for a while, I decided to quickly write this down, and if there are any questions I can expand some of these key points.

  1. Use InfoPath Designer 2010 to author your forms, even for 2007 forms. The UI is better, design checker gives you more information, and the rules editor supports copy/copy all and paste. 
    Note: design checker gives you a lot of warnings and sometimes... they can be ignored. Which ones are safe and which aren't... is as far as I know, a personal experience thing, think of it as VS.NET warnings.
  2. Design your main context fields first, and then try your best not to change existing fields (add new fields are OK). Removing or renaming fields often break existing forms that had already been filled out.
  3. Decide upfront whether this is a rich form or a browser form, and set the compatibility level appropriately. Use the design checker. 
    If you are planning to create hybrid forms that works on both - there's a form option that will allow your code behind to use the Rich Form API but still check the form for Browser Form compatibility. In this case, always check in your code whether the form is running in the browser before you call those APIs, otherwise you will get UnsupportedExceptions.
  4. If you need to promote InfoPath fields to SharePoint so they appear as columns (and can be used in workflows), you should always use site columns. You might want to consider always using Content Type as well. 
    It may be tempting to use publish to list - but this creates list fields that are now very hard to manage, and when you realize down the road that you should have used content types, you now have to fix existing list columns and move their data to the site columns. This always happens.
  5. Brush up on your XPath skills well. InfoPath renders every view via a XSLT transform and the output is actually a HTML page (either for rich form or web forms). You need to use XPath when you want to start defining rules that are relative to the current field. Why use rules when you can use code behind? See next point.
  6. Code behind are powerful, and may look much simpler to a developer, but has deployment considerations. In 2010, code behind can run either in a farm solution, or via the sandbox user code service. However, code in the sandbox service sometimes may not run when the service is "busy". Your best bet is either: deploy code through central administration - if you have access, but then you trip up tip #4 if you haven't been using site columns, or don't use code behind and write your logic using only rules. You can find detailed InfoPath documentation for developers on MSDN (it may not look like much, but you have functions like get-SharePointServerRootUrl that are just gems hiding) 
    Plus, trust me you feel awesome when you can write complex logic using declarative XPath and no C# code. It's like saying yes I could cheat and just use C#, or I can be godlike and do it in XPath.
  7. Copying pictures increases your resource size. The best way for a repeated picture is to include it as a resource, then use a picture button and set the image to your included resource. Unfortunately you can't set the image of a picture control.
  8. Export form as Source files, and work with the manifest.xsf. While I'm pretty certain it is unsupported to tweak the view.xsl files manually by hand, at least you can now put all the component files within a source control and check what has changed using a simple text difference tool.
  9. Learn how to call webservice with Rules. InfoPath is pretty dumb beyond what's within the form. Webservices gives you lots of capabilities but only if you know how to call them. E.g. how to interact with SharePoint users.
  10. Don't use the "can't be blank" option, always create validation rules. When any validation rules fail, it puts the form into an invalid state and prevents any submit action. If you have them all defined as validation rules - you can add an additional condition that allows saving E.g. if ForceSave = "0" and "MyField" is empty 
    This gives you control over what happens when the user is trying to save, and allow you to disable the checking when you need to.





InfoPath Forms

Let’s begin by taking a look at InfoPath. InfoPath is a great tool for creating simple data-entry forms, and for retrieving data from a variety of data sources. In addition, it’s great when you need to submit data to a SharePoint form library for the purposes of leveraging a SharePoint workflow. Where InfoPath breaks down is when we need to submit data to other sources, or when we need to provide a rich user-interface with robust controls and data validation. Let’s take a look at some pros and cons of InfoPath:
Pros
  • Great for submitting data to SharePoint or a SharePoint workflow
    Most of the time when we’re using electronic forms, it is to support a workflow process. As you [should] know, a SharePoint workflow runs for a specific list item, and data needed for the workflow needs to be entered into the fields for that particular list item in order for the workflow to see it. Because of this fact that the data actually needs to be a list item, InfoPath is a great choice, because you can effortless promote form fields as columns in your list, which the workflow can then use.
  • Great for retrieving data InfoPath provides a very simple wizard interface for selecting a data source for data retrieval. You can easily select a web service, and XML document, or a SharePoint list and have that data appear in your form pretty easily. You can also connect to a SQL database and retrieve data from tables, views, or stored procedures.
  • Great for simple end-user form development
    InfoPath is great for creating a simple form with a few fields and simple rules and simple data validation. I keep emphasizing simple because once you introduce complex business rules, data validation, conditional formatting, or complex data presentation that pushes the limitations of InfoPath, you will be forced to get very creative which often involves some sort of custom coding.
  • Most of the time only requires SharePoint site permissions Unless you are creating a browser-enabled form with .NET code-behind, or your form requires Full Trust and uses the InfoPath client, it’s relatively easy to deploy a form to SharePoint. Simply publish the form to the desired form library and you’re good to go. However, as soon as you introduce .NET code in a browser-enabled form, you need to install and activate the form to Central Administration and activate the newly-created feature at the site collection level. You will need to have access to Central Administration and to the site collection in order to activate these features.
Cons
  • Difficult to submit data to non-SharePoint data sources
    Like I mentioned, InfoPath is great for submitting data to a SharePoint form library. It is not so great for submitting the data to anything else. If your form is submitting data to a single (single being the operative word here), then you could potentially configure the form to submit directly to a table. However if the data needs scrubbed or manipulated, chances are you will need to submit the data via a stored procedure, which InfoPath cannot do. For this, you will be forced to develop a custom web service that accepts the data either field-by-field, or as a giant blob of XML that you have to parse through, which you then have to submit to the database by writing traditional ADO.NET code. Not too simple anymore, huh?
  • Limited user-interface
    InfoPath allows you to create forms with a variety of standard controls, such as textboxes, date pickers, radio buttons, checkboxes, buttons, drop-down lists, repeating tables, etc.. Unfortunately, it is pretty much limited to those items (you get a few more with the rich client, but that’s beyond the scope of this post). You don’t have any type of tree view control, no multi-select list box, no tab control, no image buttons, and no grid view control. The lack of a grid view control is a deal breaker in many cases, because we often have to present long lists of data, and the built-in repeating table doesn’t support sorting, grouping, or paging. Yuck. Finally, there’s no way to add HTML or CSS to your form, meaning that it can’t inherit any SharePoint styles, and you’re limited to what you can design in the form. This frequently gives an inconsistent look and feel for a SharePoint process. Again, yuck.
  • Difficult to secure sensitive data
    Assuming the InfoPath form is being submitted to a SharePoint form library, any data the form contains is inherently insecure. The form is just saved to the form library like any other document, except as an XML document. This means if your form contains social security numbers, salary information, or any other type of sensitive data, a user could download the XML file and open it in Notepad. Even if the data isn’t visible through InfoPath, the data is still stored in the form and can be viewed by any user that knows how to download.
  • Difficult to integrate with Forms-Based Authentication
    Although browser-enabled forms will work with forms-based authentication, the useful username() function no longer works. This means that even if you’re logged into your SharePoint site as a valid FBA user, InfoPath will have no idea who you are.
  • Not developer-friendly
    If you’ve made it this far in this post, you’ll have already read that while simple things are easy to accomplish in InfoPath, complicated things aren’t and often requires .NET code. While you can definitely add .NET code to a form, it’s not the same type of form coding a typical developer is used to. You have to parse XML to retrieve field values, you have to parse XML to set field values, and you’re still pretty much limited to the functionality that you have through the designer. You can just write more complex business rules and logic, you can’t make the form or the field controls behave any differently.
  • Licensing Obviously your users need to be licensed for InfoPath Forms Services before they’re able to use it. Even if you have licenses for the InfoPath client, separate licenses are required for browser forms. If the users are internal and members of your domain, you must be licensed for InfoPath Forms Services, which is available either through the MOSS Enterprise CAL or the standalone InfoPath Forms Services CAL. If the forms are going to be available externally to non-domain users or anonymous users, then you must be licensed for either Office Forms Services for Internet Sites or be licensed for SharePoint for Internet Sites, which is the external connector that provides the ability for an unlimited number of users to access and use InfoPath through a browser.
ASP.NET ASPX Forms Creating ASP.NET ASPX forms offer the most in terms of flexibility, as you can do anything that you can do in a traditional ASP.NET web site, including HTML, CSS, JavaScript, and even AJAX. A lesser-known technique is integrating these pages into the SharePoint “shell” to give users a seamless experience. It doesn’t take much effort to have SharePoint host these pages and have the master page and styles applied to your custom forms. Let’s take a look at some pros and cons associated with ASP.NET forms:
Pros
  • Great for submitting data to non-SharePoint data sources While InfoPath is great at submitting data to a SharePoint form library, ASP.NET forms are great for submitting data to everything else. You can easily write your ADO.NET code or whatever-you-like code to submit to your data source, and not have to worry about parsing a bunch of InfoPath XML first in order to pull out the values. It’s a lot less work to get the data into your data source.
  • Great for providing a rich user interface Unlike InfoPath, you aren’t limited to a tiny set of field controls. You can use whatever an ASP.NET web site supports, including tree view, tab controls, grid views, AJAX – even Silverlight if you really really want. You can also provide any type of business rules and validation you like as well, including summaries, friendly pop ups, etc. Also, since the pages are inheriting the SharePoint styles and master page, your forms will automatically pick these styles up, and will also use the master page. This gives the appearance that they’re actually built-in SharePoint pages. It’s slick. There are plenty more options for developing a rich and clean user interface if you’re developing ASP.NET forms.
  • Developer friendly This one’s a no-brainer. Obviously if you’re familiar with ASP.NET and .NET programming, creating data-entry forms are a cinch. There’s no learning curve with learning how to code an InfoPath form, and you don’t have to learn the ins and outs of the InfoPath object model. This opens up the development work to a wider audience of our developers, as not many have hands-on experience with writing .NET code behind an InfoPath form. In addition, should any future updates be required to the form or the code, finding resources on ASP.NET online or hiring someone with ASP.NET skills will not be a difficult task. It’s a widely practiced technology, and there are a ton of resources.
  • Can provide secure means of sensitive data access
    Since no data is actually stored in the ASP.NET form, it provides a much more secure way of viewing sensitive data, as it will have to be retrieved and submitted to the database directly. A user can’t download an ASP.NET form and see the data like they can with an InfoPath form.
  • Integrates well with Forms-Based Authentication
    By using an ASP.NET form in an FBA-enabled site, we are able to see the user that is currently logged in, unlike with an InfoPath form.
  • Access to the SharePoint Object Model Since the ASP.NET forms are running under the context of the SharePoint site they’re accessed from, we can use the SharePoint Object Model to do whatever we wanted. We could very easily access SharePoint list or site data, user profile information, etc., and bind that information to controls on the form. To do this in InfoPath, you’d have to use the unfriendly out-of-the-box SharePoint web services, or write your own.
  • Licensing Not required! There aren’t any licensing headaches when exposing ASP.NET forms to users, even externally. Obviously since they’re going to be integrated into SharePoint, you’ll have to have the appropriate licenses for that, but nothing specific to the forms themselves.
Cons
  • Potential additional development overhead Obviously writing custom ASP.NET forms requires a competent ASP.NET developer, which may not always be available (though I’d argue that in order to develop some of the complex forms that we have had to do in the past – you will still need a very competent .NET developer). In addition, changes to simple business rules or data validation is more difficult to accomplish in ASP.NET than in an InfoPath form. If the form is simple and doesn’t require data going to SQL, then an end-user is probably better of just using InfoPath.
  • Requires file system access on SharePoint server To deploy custom ASP.NET forms to SharePoint, they need to be placed onto each web front-end’s file system. In addition, the assembly must be deployed to the GAC or to the web site root’s BIN directory. Either way, the developer must have access to the file system, or to someone that has access to the file system.
  • Not business-user friendly One good thing about InfoPath is that business users can even build simple forms. They will probably not be able to develop an ASP.NET form in .NET. If the form is truly that simple, then creating ASP.NET forms is probably overkill anyways, and InfoPath should be the recommended solution.


So, How Do I Choose? Great question! The answer should be easy -- do the simplest thing possible that will result in a clean solution. If you can implement the desired functionality quickly and painlessly in an InfoPath form, then by all means do that. If developing an InfoPath will actually be prohibitive to functionality and future maintainability, then consider building custom ASP.NET forms.
InfoPath Basics - Display text box if user selects Other using conditional formattingPromote two fields to a single SharePoint or Database column/field.


This article demonstrates how to configure an InfoPath form to display an optional text box for the user to enter a custom value if not available from the list of options. A separate field in the main data source of the InfoPath form will be used to store the value of the selected option, or the custom value if supplied by the user. Rules are set up to set the value of the separate field in the data source when an option is selected or when a custom value is entered into the text box. When submitting the form, the text field with either the value selected, or the optional text input entered if the user selects other can be promoted to a single SharePoint column, or database table instead of promoting both the option field and the text field containing the "Other" value if selected.


Conditional formatting is also used to hide the text box until the user selects "Other" from the list of options.


Process:Set up the Initial InfoPath Form


1. Design a new form template using InfoPath 2003 or 2007


2. From the Task Pane (CTRL+F1), open the Controls toolbar


3. Double click, or drag an Option Button control onto the default view of the form template. Enter the number of options required (remember to add an additional option for "Other").













> Note: In this example, the Option Button will have 5 options including "Other". The name of this field in the Main Data Source will be "Options"4. Right Click the first Option and select "Option Button Properties..."























5. Enter a Field Name for the field. Note: You only need to set the field name on one of the options for it to be applied to all.


6. Enter the value which will be used when this option is selected for the "Value when selected".


7. Press Ok



















8. Repeat Step 6 for each option. Enter "Other" as the value when selected for the final option.


9. Add a text field control to the form template (main data source) for a user to enter a custom value if required.











Note: In this example this field will be called "Other".10. Add a separate text field to the form's Data Source only to store the selected value, or the value from the "Other" field by selecting "Add..." from the menu after right clicking the "myFields" group.

















Note: For the purpose of this article, this field will be called "OptionSelected". This field does not need to be added to the form template. This field will contain the selected value from either the "Options" field or the custom value from the "Other" text field if required, and is explained further in the article.
Add Conditional Formatting to hide the "Other" text field when it is not required
11. Right Click on the "Other" text field control on the form template.
12. Select Conditional Formatting...
13. Press the "Add..." button to add a condition
14. Select the "Options" field created in step 3, "is not equal to" for the condition, and a text value of "Other" to test against (Select "Type text..." from the options).









15. Tick the "Hide this control" option for the formatting to be applied.

















The "Other" text field will now only be visible when the user selects the "Other" option radio button.

Thursday, September 9, 2010


InfoPath Tip: Working with radio buttons and check boxes

1. This is how form with controls will look like.
clip_image001
Fig 1: Form
2. Add conditional formatting to Section 1 to hide it when Checkbox 1 is checked.
clip_image002
Fig 2: Conditional formatting for Section 1
3. Add conditional formatting to Section 2 to hide it when Checkbox 2 is checked.
4. Add rule to Option 1. By default, the value of Option button 1 is "1" and value of option button 2 is "2". Name rule "Open Section1" and set condition:
clip_image003
Fig 3: Set condition for Rule "Open Section1"
5. After setting the condition, click "Add Action" button to add action. In the "Field", select "Checkbox1" then click the "fx" button to add formula.
clip_image004
Fig 4: Add Action
6. Use "Insert Function" button to add "boolean" function or write it directly in the formula box. Click "Verify Formula" button to verify the formula and then click "OK".
clip_image005
Fig 5: Add Formula
7. You need to add three more rules. The rules are shared between the two radio buttons. Rules established for any of the buttons, both buttons. Add the second rule of "Close Section 2". Set the following condition:
clip_image006
Fig 6: Set condition for rule "Close Section 2"
Add action for this rule. Select "Checkbox1" in "Field" and leave the value blank. This will uncheck the "Checkbox1".
8. Add third rule "Open Section 2" to open the section 2. Condition set: Options is equal to "2" and add the action: "CheckBox2" has a value "Boolean (" true "). Use the technique described above to add formula. Remember, the formula of writing by hand is not set the Boolean value and will be considered as plain text in InfoPath.
9. Add fourth rule "Close Section 1". Add following condition:
clip_image007
Fig 7: Set condition for rule "Close Section 1"
Add following action:
clip_image008
Fig 8: Add action
Select "CheckBox1" in the "field" and uncheck the value. This disables the "CheckBox1". Remember that the sections are associated with those checkboxes. Checking CheckBox1 display section 1 and unchecking that hides in section 1. Similarly, CheckBox2 display control section 2 and unchecking that hides in section 2.
That's all. The point, in short, is that you must set the value of the box to "blank" to disable. Setting it to "False" is not uncheck.

InfoPath-Automatically change the first letter of a word/sentence to upper case

Problem



When an InfoPath user types in the text "example" or "this is really cool!", you would like this text to
automatically be changed into "Example" or "This is really cool!" when the user leaves the text field.

Solution



Use the concat(), substring(), translate(), and string-length() functions
in a formula to format the text field.



You can accomplish this functionality as follows:


Create a New Blank Form in InfoPath.


  1. Add a Text Box control to the form.
  2. Double-click on the text box control to open its Properties dialog box.

  3. Click on the Insert Formula button behind the Default Value field.
  4. Enter the following formula on the Insert Formula dialog box:
    concat(substring(translate(., "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"), 1, 1), substring(., 2, string-length(.) - 1))
  5. Click on the OK button when closing all open dialog boxes.
The first letter of a word or sentence typed into the text box should now automatically be converted into an upper case letter