Logo 
Search:

Sharepoint 2010 Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint 2010       RSS Feeds

New to SharePoint 2010

  Asked By: Sekhar    Date: Nov 09    Category: Sharepoint 2010    Views: 700

I'm a new-be to this software, no tutorials or courses. I have obtained some
e-books and have installed SP in the correct manner on a VM.
My first step is getting accustomed with creating forms using Infopath and
applying a workflow (approval) to the form once a user submits it.

I have managed to create a form however am stuck with creating a certain field.
I would like to create fields in the form which would automatically insert the
users name, department, designation etc. once the user opens this form. Would
this be possible please?

Share: 

 

6 Answers Found

 
Answer #1    Answered By: Kartik Athani     Answered On: Nov 09

These two articles should get you moving in the right direction:

blogs.microsoft.co.il/.../InfoPath-_2D00_-Get\
-the-current-user-without-writing-code.aspx

claytoncobb.wordpress.com/.../

 
Answer #2    Answered By: Tyra Hewitt     Answered On: Nov 09

If I got any queries hope it's ok to drop a line here.

 
Answer #3    Answered By: Yessenia Dejesus     Answered On: Nov 09

Yes, this is possible.

Getting the user's network name into a field in InfoPath is trivial. You put a
textbox control on the form, let's say you named it UserName rather than leaving
it named field1, and set its default value to the function userName() (pick the
funtion from the fx button to be sure you spell it correctly).

Doing a lookup from the People properties in SharePoint to fill in other fields
such as Department is a little more complicated. First of all, you have to
create a data connection for retrieving data, select web service, and for the
location of the web service give <URL to root of
SharePoint>/_vti_bin/people.asmx?WSDL. For the operation, pick SearchPrincipals.
You will be asked to set the parameters for the search. For testing purposes you
can put your own network name for the initial value of searchText, but you will
be setting that later to be filled in by the value from the UserName field. Set
the maxResults to 1 and the principalType to User. Make sure after clicking Next
twice and giving it a good name such as SearchPrincipal that you uncheck
Automatically retrieve data, because you are going to set the order of when data
is retrieved, so that you can execute the query at the right time. Click on
Finish. Now you have to set the Tools->Form options, click on the Open and Save
category, and click on the Rules, in order to set several rules to run when the
form is opened. The first rule's action should be to set a field's value, and
the field is UserName and the value is the function userName(). The second rule
is to set a field's value, and this is a field not from the Main data source but
from the secondary data source you called SearchPrincipal.You want to set the
searchText field to be the value in the field UserName. This is how you pass the
network name of the current person who opened the form to the SharePoint people
web service. The third rule is to query using the data connection called
SearchPrincipal.

The last step is to create a field called Department, and set its default value
to come from the SearchPrincipal data connection, the value of the field called
Department. While setting this up, you can look to see the other fields that are
returned: AccountName, DisplayName, Email, Department, and Title.

 
Answer #4    Answered By: Nikunj Kansagara     Answered On: Nov 09

I have another query. What if I want to use an Active Directory and when a user
opens a form (with an attached workflow) on SharePoint, it automatically inserts
the user that is logged on into the Username field on the form as well as
entering the other details (department, job position, date etc).

 
Answer #5    Answered By: Savanna Albert     Answered On: Nov 09

First of all, thanks for all your help. Slowly yet surely I am getting used to
SharePoint.

However, I am a bit stuck in the following section:

Doing a lookup from the People properties in SharePoint to fill in other
fields such as Department is a little more complicated. First of all, you have
to create a data connection for retrieving data, select web service, and for the
location of the web service give <URL to root of
SharePoint>/_vti_bin/people.asmx?WSDL. For the operation, pick SearchPrincipals.
You will be asked to set the parameters for the search. For testing purposes you
can put your own network name for the initial value of searchText, but you will
be setting that later to be filled in by the value from the UserName field. Set
the maxResults to 1 and the principalType to User. Make sure after clicking Next
twice and giving it a good name such as SearchPrincipal that you uncheck
Automatically retrieve data, because you are going to set the order of when data
is retrieved, so that you can execute the query at the right time. Click on
Finish. Now you have to set the Tools->Form options, click on the Open and Save
category, and click on the Rules, in order to set several rules to run when the
form is opened. The first rule's action should be to set a field's value, and
the field is UserName and the value is the function userName(). The second rule
is to set a field's value, and this is a field not from the Main data source but
from the secondary data source you called SearchPrincipal.You want to set the
searchText field to be the value in the field UserName. This is how you pass the
network name of the current person who opened the form to the SharePoint people
web service. The third rule is to query using the data connection called
SearchPrincipal.
>
> The last step is to create a field called Department, and set its default
value to come from the SearchPrincipal data connection, the value of the field
called Department. While setting this up, you can look to see the other fields
that are returned: AccountName, DisplayName, Email, Department, and Title.

I tried to carry this out however when I tried to use a text box it would not
allow me to do the following. Would appreciate it if you could guide me in the
right direction please.

 
Didn't find what you were looking for? Find more on New to SharePoint 2010 Or get search suggestion and latest updates.




Tagged: