Solved

Get the current form list column name and fill it by another custom list field

Posted on 2013-01-28
4
299 Views
Last Modified: 2013-02-05
Dears,

 I have SharePoint 2010 Form Library. When loading this form library, I need to fill some fields like name, department, hire_date from another custom list  where all these information are already exist. Both forms are identified by a unique ID.

How to do these by using Visual Studio Loading Event option (under developer tab) by InfoPath 2010?
0
Comment
Question by:mshaji
  • 2
  • 2
4 Comments
 
LVL 50

Expert Comment

by:teylyn
ID: 38829818
Hello, you need to define a data connection to the other list. Then create a rule that fills the fields when the key field changes. Filter the data source by the key field. To do that, set a field value in the secondary data source, using the appropriate field in the query field group. Then query the data connection. After that simply set the main data source fields with the values of the (now filtered) secondary data source fields.

Code is not required for that.

Cheers, teylyn
0
 

Author Comment

by:mshaji
ID: 38829871
Thanks for the supoort dear,

I am not getting your points. Can you explain it in details please.

Lets say, I have Custom list Named: New_Arrival_Form  (First list) with fields Badge_No, Name, Nationality, Designation, Grade, Hire_Dt  

I have another list named: New_Arrival_Form_Evaluation (Second list) with fields New_Arrival_Form_ID  (this is the ID of the custom list), Badge_no, Name, Nationality, Designation, Grade, Hire_Dt

Now, when a user click a row record of the  fist list then the page will redirect by passing the ID of the first list  to the second list.

and when the second list loads then it will fetch the data from the fist list by using the passed ID and will display in the fields of second list like Badge_No, Name, etc

I hope this will clear my goal

Regards
0
 
LVL 50

Accepted Solution

by:
teylyn earned 500 total points
ID: 38830180
Edit the list form for the second list. The fields in that list are the main data source. In the field panel on the right, underneath the list of fields, click "Advanced View".

Create a new data connection and point it to the first list. Include all the fields that you want to look up and also include the ID field of the first list. This data connection is the secondary data source.

Create a new rule for the field New_Arrival_Form_ID. The rule should be executed whenever the field changes. Create the following actions:

Set a field's value
- Field: select the secondary data source, open the query fields node and select the ID field. If you don't see a drop-down to change the data source, click "Advanced View" below the list of fields.
- Value: select New_Arrival_Form_ID from the Main data source

Query for data
- select the data source for the first list

Set a field's value
- Field: Badge_no field in the Main data source
- value: Badge_no field from the data fields node of the secondary data source

Set a field's value
- Field: Name field in the Main data source
- value: Name field from the data fields node of the secondary data source

repeat for the other fields.
0
 

Author Comment

by:mshaji
ID: 38853907
Some part helped
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I recently came across an issue with a MOSS 2007 deployment where access into some sub-sites were denied, even for the MOSS farm administrators. A bit of background to the setup of this MOSS farm; this was a three server setup, consisting of a fr…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
This video discusses moving either the default database or any database to a new volume.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now