Clayton's SharePoint Madness

All About SharePoint, InfoPath, and SharePoint Designer!

Archive for the ‘SPD 2010’ Category

Things related specifically to SharePoint Designer 2010

InfoPath – Allowing Anonymous users to Submit Forms in SharePoint 2010

Posted by Clayton Cobb on June 3, 2011


You all know how much I like InfoPath, so you probably know how much it pained me not to be able to provide InfoPath forms to anonymous users in SharePoint 2007. For one, you don’t want to use a Filler form, because it’s a guarantee that not every anonymous will have InfoPath installed locally. However, even if we used browser forms, anonymous users are not allowed to submit documents. There are some permissions hacks for working around that to some degree, but they are not recommended. There is another method where you can set up a web service submit to use the Lists.asmx web service for submitting the data from the form to a list without actually submitting the InfoPath document (XML). S.Y.M. Wong-A-Ton has a great article showing 5 ways to submit to lists from library form templates: 5 Ways to submit an InfoPath form to a SharePoint list.

So, the good news is that we now have a brand new feature in SharePoint 2010 that allows us to utilize InfoPath as LIST forms. This is an amazing new feature, because people have been customizing their ASPX list forms for years with SharePoint Designer, but it was nowhere near as easy nor as powerful as using InfoPath; however, there was no way to use InfoPath directly for list forms. That has all changed, because now we can do it. Because of this, we can also allow our anonymous users to submit customized InfoPath forms without any custom web services, without the need for code, without any permissions hacks, and generally without any fuss at all. In this blog post, I am going to show you how – it’s very easy.

***Warning: InfoPath list forms are ONLY available in SharePoint Server 2010 Enterprise, because they are considered browser forms. Of course, this is the same for library-based browser forms, so this would be no different if trying to use library forms.

Here are the major steps we’ll cover:

  1. Configure a SharePoint site to allow anonymous access
  2. Create a Customers List that allows anonymous submits
  3. Convert the list to InfoPath
  4. Create a custom page for anonymous user interaction with the InfoPath form

Configure a SharePoint site to allow anonymous access

  • First, you need to enable anonymous access at the Web Application level by browsing to Central Administration > Application Management > Manage Web Applications. In this example, I have a new web application named “Anonymous,” and I have set it to allow anonymous access (Fig. 1 and 2).

Figure 1 – Managing the “Anonymous” web application. Click Authentication Providers in the ribbon

Figure 2 – Enabling anonymous access for a specific zone in a web application

  • Next, you need to enable Anonymous Access on a site within the above web application. If you created a new web application, then create a new site collection. If you modified an existing web application, then either create a new site collection or browse to a site on an existing site collection. Once you decide where you want to test this, browse to that site and click Site Actions > Site Permissions. Then, click the Anonymous Access button in the ribbon (Fig 3).

Figure 3 – Enabling Anonymous access at the site level

Figure 4 – Choosing the scope of access for Anonymous users

  • At this point, you should be able to browse to this site without getting prompted to log in even if you do have the ability to authenticate. Instead of seeing your name in the top right corner of the page, you should see a link that says “Sign In.” (Fig. 5)

Figure 5 – Browsing to a SharePoint 2010 site anonymously

Figure 6 – Result of signing in to the same site as an authenticated user

Create a Customers List that allows anonymous submits

This is just an everyday activity in SharePoint, but we need it in order to show the solution.

  • On the site from above, create a new Contacts list named “Customers.” (Fig. 7)

Figure 7 – Creating a new Contacts list on the Anonymous site

  • Go to the List Permissions and stop inheriting permissions first (Fig. 8)

Figure 8 – Breaking permissions inheritance on the Customers list

  • Now, allow Anonymous users to Add items (edit and delete are optional, but not recommended). (Fig. 9, 10, and 11)

Figure 9 – Clicking the Anonymous Access ribbon button after breaking permissions inheritance

Figure 10 – Adding the “Add Items” permission for Anonymous users on the Customers list

Figure 11 – Results of giving Add Items permission to Anonymous users

  • Now, your anonymous user should be able to add an item to the Customers list (Fig. 12).

Figure 12 – View of Customers list as an anonymous user

Convert the list to InfoPath

  • Now, we get to use the awesome new feature of InfoPath Forms Services that allows us to modify list forms with InfoPath. You must be logged in as an authenticated user to do this, and you must use Internet Explorer to invoke it from the ribbon or from the List Settings > Form Settings page. You can also invoke this change from the list settings page in SharePoint Designer 2010. (Fig. 13, 14, and 15)

Figure 13 – Converting the list to InfoPath in the Customize List section of the List Tab of the List Tools ribbon

Figure 14 – Converting the list to InfoPath in the List Settings > Form Settings

Figure 15 – Converting the list to InfoPath in SharePoint Designer

  • When doing any of the above, a new InfoPath list form template opens on your local machine, so be sure you have InfoPath 2010 installed. The template will have a basic table with all the list columns displayed. Likewise, all the fields are visible in the data source pane on the right (Fig. 16).

Figure 16 – Default list form template for the Customers list

  • Now, you can customize the form to make it look how you want, and you can even add data connections, but just be sure the users have permissions to the source of those data connections. My form below has a banner image, a thinner table for the default fields, a custom submit button, and a few repeating tables for showing secondary data from other lists on the site (Fig. 17).

Figure 17 – Customized InfoPath list form template for the Customers list

  • Notice that the anonymous user is able to open this form by clicking “Add new item.” I purposely right-clicked and chose “open link in new tab” to avoid the modal dialog, because you wouldn’t be able to see that the user is anonymous (Fig. 18). Notice also that the two repeating tables on the right are both populated with data from other lists (tasks list and the same Customers list).

Figure 18 – Customized list form opened by an anonymous user

  • Notice below how I am an anonymous user, and I can see items submitted by both authenticated users and anonymous users (Created By is blank).

Figure 19 – Viewing list items submitted by authenticated and anonymous users in the Customers list

Create a custom page for anonymous user interaction with the InfoPath form

So, you can already see that anonymous users can easily submit to lists using InfoPath forms, but I’m going to show you one more step so that you see it can all be done through the InfoPath Form Web Part through a guided interface instead of the user going directly to the list.

First, let’s create a custom page with nothing on it except the InfoPath Form Web Part. This part of the blog is something I just now built to demonstrate, so it has no design elements at all – I’m just showing an example – but you can probably get very creative for your anonymous users so that they only see what you want them to see.

  • To create the type of page I’m using, open the site in SharePoint Designer 2010, click on the Site Pages Site Object (left navigation), and in the ribbon click New > Page > ASPX. This creates a new, blank page with nothing on it.
  • Click on the page to get to the page settings, and then click Edit File.
  • In the ribbon, click Web Part Zone in the Web Parts section
  • Put your cursor inside the Web Part Zone and click Web Part > More Web Parts. Search for the InfoPath Form Web Part and select it
  • Now, you should have a blank page with an InfoPath Form Web Part inside a Web Part Zone (Fig. 20)

Figure 20 – Blank ASPX page with a single Web Part Zone containing a single InfoPath Form Web Part

  • Now, right-click on the web part and click Web Part Properties
  • This will show you the InfoPath Form Web Part properties so that you can connect it to the Customers list. Notice that I have disabled the ribbon so that the user can only utilize my custom Submit button, and I have configured the submit behavior to open a new (blank) form upon submit. What this does is insert the data to the list and then present the user with a fresh, new, blank form (Fig. 21).

Figure 21 – Configuring the InfoPath Form Web Part to utilize the Customers list form

  • Now, you just save the form and send that page’s direct URL to the anonymous user.
  • When the anonymous user clicks on the link, this is the result (below). Notice the page opens in the browse with nothing else visible – no ribbon, no master page, no border or other miscellaneous indicators (Fig. 22). You could also add other web parts – either hidden or shown – that are connected to this form for input and/or output purposes, such as a Query String Filter Web Part that could read from the URL and insert that data to the form, which could then trigger rules and/or switch views to provide a personalized experience.

Figure 22 – Opening the Customers list form as an anonymous user through a custom page

Since there is no indicator in Figure 22 for which user that is, I am providing a bonus screenshot below that shows the same technique utilized on the Home page of my Anonymous site (Fig. 23).

That’s all there is to it. This is very easy to set up and works very, very well. Unfortunately, items submitted by anonymous users can’t automatically trigger workflows, so I’m hoping that will either be changed in the future or that we’ll be able to figure out a way (without code). Even so, this gives you a great way to provide a powerful, nice-looking interface to your anonymous users so that they can submit data using a logic-filled form without the need for custom code or any heavy customization.

Advertisements

Posted in InfoPath 2010, Office 2010, SharePoint 2010, SPD 2010 | 15 Comments »

Solving Business Problems with SharePoint and InfoPath

Posted by Clayton Cobb on April 26, 2011


How business users can solve business problems by collecting and managing data more effectively

Using SharePoint and InfoPath

  • FirstLook-InfoPath (PowerPoint slides from the presentation)
  • Video of presentation coming soon

This Free First Look Clinic will be held on Friday, April 29 starting at 9:30am until 2pm at the LeaderQuest facility in Denver.  This clinic will be taught by Clayton Cobb of Planet Technologies.

Although InfoPath has been a part of the Office since the 2003 version, most people haven’t even known it was on their desktop.  Now, though, with the release of both Office 2010 and SharePoint 2010, the importance of utilizing InfoPath has grown to the point that people are finally starting to take notice.  InfoPath is embedded all over the SharePoint 2010 product as well as other Office 2010 products, which makes it an invaluable tool to learn whether it be as a developer of forms and solutions or as a user who understands that this tool can be considered when determining different ways to resolve business issues.

Clayton Cobb, a former InfoPath MVP and current SharePoint MVP, will walk us through what these two products mean to each other.  You will first learn what InfoPath is by looking at it directly, building a  simple form, and talking about the basic features.  From there, we will see how to integrate this form with SharePoint 2010.  After that, we will delve deeper into the other integration points between SharePoint and InfoPath. Lastly, we will walk through a multi-system-integrated, multi-product, fully-automated Leave Request system built on InfoPath and SharePoint 2010 as the main platform without a single line of code.

Posted in InfoPath 2010, Office 2010, SharePoint 2010, SPD 2010, Visio 2010, Workflow | 14 Comments »

SharePoint Designer 2010 Workflow Actions and Results

Posted by Clayton Cobb on December 12, 2010


A list of SPD2010 Actions, what they do, and their different results.   There are tons, so I’ll keep adding more as I go along…

Date/Time Field

Sample Value: 8/2/2010 12:00 AM (Mountain Daylight Savings Time)

Format Options:

  • As String:    8/2/2010 12:00:00 AM
  • ISO Formatted:    2010-08-02T06:00:00Z (Zulu – GMT)
  • Long Date:    Monday, August 02, 2010
  • Long Time:    12:00:00 AM
  • Short Date:    8/2/2010
  • Short Time:    12:00 AM

People Picker Field

Environment Details:

  • Claims Mode Web Application
  • Windows Authentication
  • Default Created By field
  • Sample Value: Jackson Cobb (Hyperlinked Display Name)

Format Options:

  • As String:        i:0#.w|warr\jcobb
  • Display Name:        Jackson Cobb
  • Email Address:        jcobb@warr.com
  • Login Name:        i:0#.w|warr\jcobb (this is the true, underlying XML value of a Claims Mode People Picker field)
  • User Id Number:    16 (This account was the 16th to be added to the User Information List for this site collection. This is driven by an entry into the UserTable of the content database within which this site collection resides)

User Profile (Data Source)

Posted in SharePoint 2010, SPD 2010, Workflow | 10 Comments »

MSDN Forums SharePoint Task Force – A Call to Arms!

Posted by Clayton Cobb on August 16, 2010


**As a reminder and point of emphasis, this is not just about sheer numbers, but rather it is about increasing the quality of the forums for everyone involved, including ourselves. If we work hard, then the numbers will come, but we are not looking to purely add posts to the forum. We only want to see meaningful, well thought out responses that help the online community – both the thread creators and the rest of us who read the threads. Thank you!

**1st milestone update on 9/1/2010. It’s only been 2 weeks, but I’m doing a pulse check to see how we’re doing. I think the results are amazing so far!

**2nd milestone update on 11/7/2010. It has now been just under 3 months, and the impact has been huge. There have been more answered threads in the last 3 months than in all previous months combined before we started the Task Force. It’s absolutely not just due to the Task Force, but I believe we have helped spark a major upswing in quantity AND quality of responses…

Special Kudos to these Task Force members:

  • Steve Curran, Corey Roth, Dave Hunter, Alpesh Nakar, Spence Harbar, John Ross, John Ferringer, Wictor Wilen, and Todd Wilder for all busting their tails to rack up over 500 points (honorable mention to Roland White for 499!).

In 3 months of work, here is the impact so far:

  • Each of the 4 SP2010 forums have an increased answer rate of over 10 percentage points with SPD/InfoPath rising over 15 percentage points
  • All 4 SP2010 forums are over 50% in answer ratio when none were over 45% when we started. 2 of the 4 are almost up to 60% overall.
  • Each SP2010 forum has had a significant decrease in # of threads with no replies. The Visual Studio forum has dropped the most – by 5.63 percentage points – just above SPD/InfoPath at 5.42 percentage points. None of the forums are above 12% now.
  • 6004 new threads have been posted and 4552 threads have been answered for an answer rate of 75.82%
  • 4552 answers in 3 months equals 53.4% of the total answers given EVER in the 2010 forums and amounts to 114.7% of all answered threads prior to the formation of the Task Force
  • Task Force members contributed 3420 posts and 1331 answers (38.9% answer ratio). This accounts for 29.2% of all answers during this timeframe
  • Despite 6004 new threads being posted, the total # of threads with no replies has only gone up by 230 (3.8%)
  • Answer rates for all SP2010 forums are above 72% during this span with Visual Studio leading the way at 81.4% followed by SPD/InfoPath at 78.8%

Due to lack of participation, the Task Force member list was pared down considerably. Anyone with less than 10 posts over the last 3 months was removed, though their contributions are appreciated. It is just very time-consuming to track so many people, so I’ve narrowed it down to so, since some are on the bubble, and I’d like to see continuous contributions.

We still have a long way to go, so let’s keep it up. I hope those who signed up and haven’t started yet are ready to get cranking, and I hope we get more all-stars to join – many are already doing it on their own, so I hope they decide to join the list. Keep rockin!

Ok, folks, the SharePoint forums at MSDN/TechNet seriously need our help. We have an amazing community that gives and gives through user groups, SharePoint Saturday events, major conferences, tons of blogs, tons of books, articles, newsletters, etc., but we have an incredible resource right in front of us that needs a lot more attention. Microsoft provides a set of forums for the entire world to benefit from, and there is an entire area devoted just to SharePoint. There is a pre-2010 SharePoint forum with 17 sub-forums, and there is a 2010 SharePoint forum with 4 sub-forums. These areas provide immeasurable amounts of valuable information to people worldwide who need to either learn about SharePoint or get a question answered. Unfortunately, though, our answer rate in the SharePoint forums pales in comparison to almost every other product category. We have thousands upon thousands of questions that have gone without a single reply and many thousands more without correct answers. The product team and the moderator team do their best to keep pace, but they can’t do it without us. We, the community leaders, community givers, and MVPs are the real people who drive this train, but there aren’t currently enough of us.

That’s why this is a call to arms. I know that not everyone can spend every day on the forums answering questions, but if all of us band together to give a little more effort than we have in the past, then it will make a huge difference. We have the 3rd-largest MVP community, but we have one of the worst answer ratios. I’m ready to change that, but I need help. I need help from people who are already recognized experts – do you realize how exciting it is for a new person to see their question get answered by a 5-time MVP who also authored the book in their cabinet? I need help from people who don’t even realize they can help – if you do SharePoint for a living and are the expert to your client, then I guarantee you have knowledge to share that someone else doesn’t yet have. I need help from people who spend tons of time contributing to the community in other ways but haven’t considered the forums to be a valuable place to spend time – I’m telling you that this is very important, and it will be very rewarding to you and the people you help.

Now, here is the empirical data – just showing the 2010 forums for now – and here is our Task Force! We have a nice mix of wily veterans, occasional dabblers, and noobs. J

 

  

8/15/10

11/7/10

Name

Points

Posts

Answers

%

Points

Posts

Answers

%

Steve Curran

17901

2741

1119

40.8%

1790

237

116

48.9%

Corey Roth

3769

692

220

31.8%

1427

214

94

43.9%

Dave Hunter

17307

2817

1051

37.3%

1404

190

87

45.8%

Alpesh Nakar

3836

915

174

19.0%

989

166

61

36.7%

Spence Harbar

651

95

39

41.1%

950

170

55

32.4%

John Ross

8553

1802

430

23.9%

920

122

56

45.9%

John Ferringer

5412

686

363

52.9%

743

71

54

76.1%

Wictor Wilén

2904

461

179

38.8%

556

69

39

56.5%

Todd Wilder

897

203

40

19.7%

507

74

31

41.9%

Roland White

0

0

0

0.0%

499

97

26

26.8%

Randy Drisgill

3627

660

217

32.9%

389

45

26

57.8%

Chakkaradeep Chandran

3715

838

187

22.3%

386

55

24

43.6%

Sean Wallbridge

12

6

0

0.0%

250

26

18

69.2%

Rob Wilson

248

50

13

26.0%

250

32

19

59.4%

Brian Merrifield

8

6

0

0.0%

249

41

14

34.1%

Moonis Tahir

7729

1302

510

39.2%

223

27

17

63.0%

Eli Van Eenwyk

1710

307

102

33.2%

168

24

10

41.7%

Wes Preston

474

84

26

31.0%

163

19

12

63.2%

Nigel Price

83

95

5

5.3%

146

41

6

14.6%

Rajesh Sitaraman

3394

595

196

32.9%

124

12

10

83.3%

Brian T. Jackett

7

1

0

0.0%

118

24

7

29.2%

Frode Aarebrot

697

123

45

36.6%

88

11

7

63.6%

Johnny Tordgeman

8

33

1

3.0%

81

18

4

22.2%

Chris Schwab

538

80

30

37.5%

79

13

4

30.8%

Shannon Bray

5701

951

350

36.8%

70

20

3

15.0%

Clayton Cobb

27150

5500

1419

25.8%

9087

1602

531

33.1%

         

21656

3420

1331

38.9%

 

Forum

Status

8/15/10

8/15/10

11/7/10

11/7/10

11/7/10

11/7/10

General

  

  

  

  

  

  

  

  

Threads

3529

  

5785

  

2256

  

  

Unanswered

2004

  

2523

  

519

  

  

Answered

1464

42.21%

3165

55.64%

1701

76.62%

  

No Replies

481

13.87%

601

10.57%

120

5.41%

Setup / Admin

  

  

  

  

  

  

  

  

Threads

2833

  

4427

  

1594

  

  

Unanswered

1668

  

2100

  

432

  

  

Answered

1130

40.39%

2267

51.91%

1137

72.47%

  

No Replies

418

14.94%

479

10.97%

61

3.89%

SPD / InfoPath

  

  

  

  

  

  

  

  

Threads

1259

  

2245

  

986

  

  

Unanswered

709

  

919

  

210

  

  

Answered

543

43.37%

1323

59.01%

780

78.79%

  

No Replies

184

14.70%

208

9.28%

24

2.42%

Dev

  

  

  

  

  

  

  

  

Threads

1873

  

3041

  

1168

  

  

Unanswered

1027

  

1240

  

213

  

  

Answered

832

44.76%

1766

58.75%

934

81.43%

  

No Replies

315

16.94%

340

11.31%

25

2.18%

       

Diff Answers

4552

53.4%

       

Diff No Replies

230

3.8%

 

SharePoint 2010 just recently released, so there are tons of questions flooding in, but there aren’t many people answering yet. Yes, I know that it’s new, so not as many people know it yet, but I also know that there are many of you out there working with 2010 as much as possible, so I bet you know the answer to a lot of these questions. The goal is two-fold:

  • Decrease the “No Replies” to under 10% in each sub-forum
  • Increase the Answer ratios to 60% in each sub-forum

Both goals are easily attainable. We can start by going back through all threads with no replies by going to the individual sub-forum and clicking the No Replies filter at the top. Go through ALL of these to find ones you can answer, but don’t just reply for the sake of replying. Please provide valuable information or ask questions to further clarify the question in case it wasn’t clear. This will help us knock down the non-replied threads in a hurry. I will update the numbers every 2 months to show how we’re progressing. The 2nd goal is not quite as easy, but it’s still very doable. To get this number up, it requires that we truly spend time providing or FINDING the right answer. There are many times where I don’t know the answer off-hand, but I’m able to go into one of my environments to test and verify, then I give an answer. For InfoPath questions, I luckily have access to the product team for getting tough questions answered, but I know some of you have great connections with the SharePoint product team and/or with other extremely knowledgeable people who can help get these questions answered more effectively. Your help is of vital importance…

 

So, what do we do? I need volunteers. Either send me a DM to @Warrtalon, or if I’m not following you yet, send a Tweet to the #SPTF hashtag that mentions me and your desire to join up. I will follow you to get your info and add you to the list. You can also click on my Contact page to email me directly. As people join, I will take a snapshot of their forum participation to date so that I can do cross-checks later. However, this is not about individual goals or thresholds. This is about the forum itself and us working as a team to make it better. It’s up to us to make this happen…

 

Thank you all!

Clayton Cobb

SharePoint Architect & InfoPath MVP

Posted in InfoPath 2007, InfoPath 2010, MOSS 2007, SharePoint 2010, SPD 2007, SPD 2010, Workflow, Workflow | 19 Comments »

InfoPath 2010 – Designing External List Forms

Posted by Clayton Cobb on October 28, 2009


This blog entry is a direct follow-up to Business Connectivity Services (BCS) – Creating an External List from an ECT. Through this blog and the rest in the series, we will be interacting with the External List that I created based on the External Content Type from the first blog: Business Connectivity Services (BCS) – Creating an External Content Type (ECT) based on a SQL 2008 Table.

I enjoyed learning about the new BCS features and how to quickly create both an ECT and External List. However, the area I’m MOST excited about is InfoPath 2010 and all of its many improvements. One major – and I mean MAJOR – change is the ability to now modify SharePoint 2010 (SP2010) list forms with InfoPath. Being that I love to use InfoPath forms for conditional formatting purposes so that my users only see what they’re supposed to see when they see it, this is a massive improvement for me. I have not been able to do that with my lists, so it has always been a struggle. To do anything remotely close to this, you had to use SharePoint Designer (SPD) 2007 to modify your ASPX pages and their web parts. This was very cumbersome, ineffective, and even had issues like the well-known Attachments Bug (fixed in SP2, I believe, but annoying for years). Using SPD 2007, you also didn’t have the full fidelity of a forms builder like you do with InfoPath. Well, that has all changed now, and although I wish I had have had time to do a regular list form for you, we are going to focus on modifying the list forms of an External List. I was very curious as to whether or not this would be doable, because I had proven the concept with normal lists in Tech Beta build, but I couldn’t get ECTs to work. So, when I got one day to work on a newer build, I focused 100% on ECTs and anything I could associate with it. I do have a customized list form in my personal SP2010 build from which I will get screenshots and do a separate blog later. For now, we’re taking the InfoPath list form concept and combining it with the awesome External List feature.

Here are the tools used in this blog entry:

  • SharePoint Server 2010
  • InfoPath 2010 Beta
  • SharePoint Designer 2010 Beta
  • SQL Server 2008
  • BCS – External Content Type
  • BCS – External List

Here are the steps of this blog entry:

  • View existing data in SQL Server 2008
  • View existing SQL data in an SP2010 External List
  • Choose to customize list forms with InfoPath from within SPD 2010
  • Customize list form in InfoPath 2010
  • Create new list item
  • View resulting data in the SP2010 External List
  • View resulting data in SQL Server 2008

View Existing Data in SQL Server 2008

First off, we just take a quick jaunt over to SQL Server Management Studio (SSMS) to take a look at the Biz table in our ECT database, because that is the table feeding our External List. As you can see, it has 10 records (Fig 1).

Fig 1 – Existing data in SQL 2008

View existing SQL data in an SP2010 External List

Next, we mosey on over to SP2010 and browse to our External List that looks just like a normal SharePoint list except that we see the exact same data here as we did in our SQL table.

Fig 2 – Existing SQL data in an SP2010 External List

Choose to customize list forms with InfoPath from within SPD 2010

Unfortunately, in my haste to get screenshots before the machine got shutdown, I forgot to take a screenshot of this button in SPD 2010. This part is actually very important, because the behavior is different than a regular list form. With a regular list, you just browse to the list in SharePoint, click on the List tab in the ribbon (like you see in Fig 2), and you click the InfoPath icon in order to immediately customize your list forms. However, in an External List, it doesn’t work like that. In my early SP2010 build, the icon was there, but when it opened InfoPath, I couldn’t do anything. What I learned at the conference is that you have to go open the External List in SPD 2010, go to the Design tab in the ribbon, and choose “Customize List Forms in InfoPath” or something of that nature. This is the screenshot I need to get for you and add to this blog entry later. For now, though, if you get a chance to try it, you will be able to follow those instructions easily.

Once you click that button, it immediately invokes InfoPath 2010 and shows you the whole data structure for the list along with a pre-defined Main Submit data connection so that you don’t have to configure that. Your customization options within an External List form are much more limited than in a regular list form. I don’t yet have a list of what those are, but I will catalog them and add them here:

  • External list forms do not support additional data connections – I learned this one right away, because it’s one of the first things I tried. In my regular list form, I was able to do this but not on the External List form. I verified with the InfoPath product team that this is a definite limitation that will not go away. Bummer, because I love to add the UserProfileService as a data connection to 99% of my forms for user validation. My earlier blog posts explain one very good reason for this: InfoPath – User Roles in Browser-Enabled Forms Using AD Groups. To be more clear, the bolded text in this bullet is the exact error I got when trying to add a data connection.
  • Cannot change the schema – This is not an exact error, but with regular list forms, you can add a field in design time, and it will add that as a column to the list. With an External List, the schema is set and can’t be changed, so you can’t add nodes to the schema in InfoPath. I will get more verification and improved wording on this.
  • More to come…

Customize list form in InfoPath 2010

So, again, I don’t have any snaps of my form during design time, but you will see it at run time below. In this scenario, I didn’t do anything fancy at all, because I just wanted to prove the concept. However, fancy or not, one thing I could not figure out was how to change all three forms – new, edit, and display. With regular list forms, all three can be selected and changed separately. With an External List, there is just one form that gets used for each instance. No, you can’t edit the display form, but it’s the same design. The main issue I had was that the Edit form was the same as the New form, and I love to change those up as well as my Display form. All I could find in SPD 2010 were threw new PAGES that got created after I chose to customize my list forms with InfoPath. The three new pages were named newifs.aspx, editifs.aspx, and dispifs.aspx if my memory is correct. When I went to edit those directly in SPD 2010, I didn’t ever get prompted with InfoPath. What I didn’t realize was that these new pages were using the brand new InfoPath Form Web Part, which is another awesome addition. Each of those pages had a single IP Form Web Part, and in the settings of that web part, you can choose which view to display as well as which action to perform upon submit. I didn’t look closely enough to notice this, but the InfoPath team explained it to me.

So, here is how you would go about setting up three separate “forms” for an External List:

  • It’s just one form
  • Create 2 new views (3 total) and design them according to their purpose (new, edit, display)
  • Go to the editifs.aspx and dispifs.aspx pages in SPD 2010, edit them, modify the form web part, and set their view to the corresponding view of that page (editifs.aspx = Edit view).
  • Also, a trick for the display view is to set your display view as the PRINT VIEW in the properties of the default view. This will apparently cause that particular view to always show up when a display page is opened

That’s pretty simple to me.

Create new list item

After publishing your form, browse to the External List again and simply click New Item (Fig 3).

Fig 3 – Click New Item in External List

As I mentioned before, this particular form has no bells and whistles, but I did make a few changes (Fig 4). I changed the Partner field, which is not a Boolean data type, to a checkbox. In the properties of that control, I set the checked and cleared values to match the exact syntax of what is in SQL so that there would be no conflicts. I also disabled the toolbars that are built-in and added a custom Submit button instead. I like to do this, because it allows me to put conditional formatting on my buttons to only show certain buttons to certain people at certain times and to do multiple sets of rules on each one. With the built-in submit button, you can’t do that.

As you can see, I added some info for a new business, and then I clicked Submit.

Fig 4 – InfoPath-based External List form

View resulting data in the SP2010 External List

After submitting, the form returned me to the External List where I immediately could see the new business along with all of its associated data (Fig 5).

Fig 5 – Resulting data in External List

View resulting data in SQL Server 2008

A quick job back over to SSMS (Fig 6) reveals that the data was in fact written directly to SQL Server 2008 without a hitch…

Fig 6 – Resulting data in SQL 2008

Some points to consider:

  • This is just a simple, flat table structure, not a complex data structure with depth and relationships. If this is not quite complex enough for what you need to do, then please consider the DBXL tool created by Qdabra
  • I have no middle layer between SharePoint and SQL, which is not a best practice. It would be best to use a web service
  • I used the permissions of my administrator account to create the ECT and was using that same account when interacting with the form. You have the ability to connection permissions at the point you create the ECT and in the list itself
  • Not being able to add additional data connections limits the options you have for doing advanced customization and logic
  • Despite all of this, it is still awesome!

Next in line for this series:

  • InfoPath 2010 – Connecting a Form Library template to an External List

Posted in BCS, InfoPath 2010, Office 2010, SharePoint 2010, SPD 2010 | 51 Comments »