Querying manager information using Active Directory - Ernesto Machado
in

InfoPath Dev

Ernesto Machado

Querying manager information using Active Directory

Qdabra’s Active Directory Web Service allows you to obtain the manager’s alias for a given username. This means that you can load the information for the currently logged in user, then determine his or her manager, then query again to obtain the manager’s full information.

One common issue we have encountered is the difficulty to determine the sequence and triggers for the rules that call the Active Directory web service to accomplish the goal above. A previous blog entry gave you a glimpse into the sequence of necessary steps, but used a button to query the manager’s information due to a limitation around template parts. If you don’t want a button on your form, and want all the information to load when the form opens, the steps are quite similar.

The blog post explains three data connections that are necessary.

  • GetMyInfo
  • GetManagerAlias
  • GetUserInfo

When setting those up, make sure to check “Automatically retrieve data when the form is opened” for GetMyInfo, and uncheck it for the other two.

There are three general steps that need to execute:

  1. Query GetMyInfo to obtain the Active Directory information for the user that is opening the form.
    • As a result of this query you will obtain the user's alias, which you need as the input for the query in step 2.
  2. Query GetManagerAlias to retrieve the manager for the current user.
    • As a result, you’ll obtain ONLY the manager’s alias, which you’ll need as the input for the query in step 3.
  3. Query GetUserInfo to obtain the Active Directory information for the manager.

However, don't use rules on a specific field. [For example, DON'T create a rule that executes when the user’s name is retrieved from Active Directory (field is not blank).]Instead, go to Tools > Form Options > Open and Save > Rules and add them there. The rules will then execute when the form opens.

Once you’ve executed these three rules, you can use the Active Directory information as you please. You can populate fields for both the user and the manager (e.g. name and email), as shown in this previous blog entry. To try the Active Directory web service, you can download a free copy of Database Accelerator, or obtain our standalone tool by checking out the Products page on Qdabra.com.

Published Apr 27 2009, 05:49 PM by ErnestoM
Filed under:

Comments

 

Twitted by InfoPathDev said:

Pingback from  Twitted by InfoPathDev

May 1, 2009 1:29 AM
Copyright © 2003-2012 Qdabra Software. All rights reserved.
View our Terms of Use.