Solved

infopath formula

Posted on 2011-03-15
3
1,025 Views
Last Modified: 2012-05-11
Dear Sir
i create a form in infopath and connected to sharepoint form, all thing work fine.
i creata a field name "user" and i create a rule for this field from the infopath rule to display the username of the current user.
i use username() as rule.
and it is working fine, when a user from sharepoint open the form , his username is displaying in the "user" field.
but now i want to create a second field named "name" to display the name of the current user .
There is a list in sharepoint named "user information list" which contains all the information about users ( first name,last name,username, display name, company .....)
i want to create a rule in infopath for this field "name" to display the name for the current user using "user information list" .

how can i did it ??
0
Comment
Question by:spring80
3 Comments
 
LVL 7

Expert Comment

by:AlMothanaAlOmari
ID: 35136068
Hi
you can achieve this by using infopath code behind , you should write a code to expose sharepoint list then to read fro this list and write the field that you want  .

http://platinumdogs.wordpress.com/2010/06/21/sharepoint-using-the-sharepoint-object-model-with-infopath-form-code-behind-part1-of-2/
0
 
LVL 28

Accepted Solution

by:
clayfox earned 500 total points
ID: 35137572
You can do this in InfoPath without any code.

The key is filters.

When you set a fields value or make a default with a function.  Go to the user list and select the field with Display Name. Before selecting OK use the button on the lower left called filter.

Add a filter
Username = username()

This way you will get the display name from the list where username in the list is equal to the username() of the person opening the form.
0
 

Author Closing Comment

by:spring80
ID: 35139077
it is working ,thanks youu.
very good solution
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Last week I faced a strange issue recently, i have deployed SharePoint 2003 servers for one project and one of the requirements was to open SharePoint site from same server. when i was trying to open site from the same server i was getting authentic…
Pimping Sharepoint 2007 without Server-Side Code Part 1 One of my biggest frustrations with Sharepoint 2007 in the corporate world is that while good-intentioned managers lock down the more interesting capabilities of Sharepoint programming in…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

867 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

22 Experts available now in Live!

Get 1:1 Help Now