Monday, April 9, 2012

Infopath 2010 multiple views, repeating tables, and external database

This was my first infopath/sharepoint project last year.
It was straight forward and I was very glad that I had a chance to learn about infopath and sharepoint.
However, it was never published.. The reason? idk. :(

Here's the screenshot for an infopath form.
It has six different views for ItemAdded, ItemChanged, and ItemRemoved and three approval views.

Example of ItemAddedReview view


Each button(ItemAdded, ItemChanged, ItemRemoved) has only one rule. - Switch to view:viewname

Let's take a look at an ItemAdded view table.
I created a section and put a repeating table and buttons for other views.

Here are some rules for textboxes.

ItemCount_ItemAdded field is for counting how many row were added.
CatLvl1Changes field has one action rule to set Catlvl2_ItemAdded, Catlvl3_ItemAdded, Catlvl4_ItemAdded to blank when the field changes
CatLvl2Changes field has one action rule to set Catlvl3_ItemAdded, Catlvl4_ItemAdded to blank when the field changes
CatLvl3Changes field has one action rule to set Catlvl4_ItemAdded to blank when the field changes

here's drop-down box properties for CatLvl1 and CatLvl2

There are two ways of getting data for multiple drop-down box data. Maybe more....
First is that you create a full database table with all information  like this
so all drop-down box don't have to compare its value with other drop-down box values.

Another way of doing this is comparing values for two drop-down boxes.
For instance, you get the first drop-down box value, then you can populate second drop-down box menu by using a formula. value[this = that]

I used the simple one for this example since it was much better for me to create a one big database table connection then many small database tables.

Here's my data connections

POS Update Form Testers : to get people's information manually. (on my tesing environment, I can't use GetUserProfileByName nor User Information List)
GetUserProfileByName : to get people's information (check Itay Shakury's blog )
User Information List : just like GetUserProfileByName (at least on my production environment it works like GetUserProfileByName)
ItemMenuList : external database
ItemCategories  : external database
CategoryMAP : external database
CategoryMST : external database
Main submit : testing
SharePoint Library Submit : sharepoint submit

and again, this will help you to have a better form for your workflow.

No comments:

Post a Comment