Showing posts with label lookup. Show all posts
Showing posts with label lookup. Show all posts

Monday, February 3, 2014

InfoPath 2010 & SharePoint 2010 Repeating Table Pulling The Wrong Information Based Upon Combo Box Order Selection

Hello!

This issue was extremely hard to tag for a blog post, but essentially the Repeating Table displays correctly only when selecting items in reverse order of the dropdown i.e. selecting Choice 3, Choice 2, and Choice 1in that order pulls over the correct information.  If I were to select Choice 3, Choice 1, & Choice 2 the information would not query correctly.

The issue is actually a result of your rule which pulls in the additional information.  In my example, I have used a repeating table to select multiple products to one purchase order.  If you select the items in the incorrect order the SKU & Price will query incorrectly.  For my setup, I have a price list which drives my Material Description list box, which then pulls over the corresponding SKU & Price.

(note: this screenshot encompasses the fixed XPath rule)

To Fix This Issue:

You will need to update the XPath of the rules you created to pull over your other fields (mine being SKU & Price).

      Open your rule which sets the values of the other fields
     Open your set a fields value parameter
a.    
Select the insert function button (fx)
Select Edit XPath
a.    
Your original rule most likely will resemble the following:
a.    xdXDocument:GetDOM("Price List")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Part_x0020_Number[../d:Title = xdXDocument:get-DOM()/my:myFields/my:group1/my:group2/my:Material]

      Update the last parameter of the rule “Title = …” to current()

a.    xdXDocument:GetDOM("Price List")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Part_x0020_Number[../d:Title = current()]

This will resolve your issue and enable you to select from your dropdown in any order and still pull the correct details for your fields that you are setting.



Cheers!

Dan

Monday, April 1, 2013

Linking Lists & Editing The Default Display Form


This post will explain how to create a connection between two lists and then how to display the connection in the display item form. These lists are extremely simplistic, but they will help to visualize the idea. (I apologize for the small screenshots; Blogger does not seem to like my Snagit Shots)

 
Creating a connection between two or more lists can be extremely helpful and for this example I will explain it in terms of Employees and an Employer. If any of you have had to work with database schemas in the past, you will know all too well about data relationships, data integrity rules, and normalization. For those readers who have not had exposure to this yet, here are the cliff notes.


There can be many employees to one employer, so the relationship is a one to many relationship. For the linking of these lists we will want the Employer (Parent) to display all of the Employees (children) when we open the "View Item Form."

To do this we will create two custom lists (the meta data within each list does not matter for this example, but you will need the lookup field)

1.      Employer

a.       Employer Name –title

b.      Employer City – combo box

c.       Phone Number – single line of text

&

2.      Employee

a.       Employee Name - title

b.      Employed By - lookup

c.       Employee Type – radio button

d.      Emergency Contact Number – single line of text



The field which will enable this connection of the two lists is the lookup field


Within the Employees List (Child) select the Lookup field and select Employer (Parent) like I have done in the below screenshot.

 


Now that you have created the two lists, create some dummy data within Employer & Employees so there is data to select from.


I have created three list items in “Employee” linked to “Employed by" Example 1


This view is ok when viewing the data from the Employee list, but what about the view for the “Employer List?”



This view does not show us any of the employees that are linked to example 1, so we will edit the display form to show our related items.


List Tools → List→ Customize List→ Form Web Parts→ Default Display Form

 


From this page go to:

Page Tools→ Insert→ Related List→ Employee

Your View Item Form should now resemble the following



 

Congrats on creating a connection and displaying it in the “View Item Form!”