Solved

infopath formula

Posted on 2011-03-15
3
1,023 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
Comment Utility
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
Comment Utility
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
Comment Utility
it is working ,thanks youu.
very good solution
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

I have just recently built a new SharePoint 2007 farm on a complete Windows 2008 R2 server platform and part of my standard build procedure is to implement a warm up routine, usually in the form of a script that is scheduled every morning to launch …
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

6 Experts available now in Live!

Get 1:1 Help Now