The Query objects defined in the directory abstraction layer let you predefine LDAP searches that you can then execute from a workflow form. The information in this section illustrates how you can define a query and use it in a form.
Suppose that you want to distribute calling cards to certain employees, but you only want to distribute calling cards to employees who work at home, and whose homes are located outside of the local office’s area code. You create a workflow form that allows the employee to:
Verify that they qualify to receive a card.
Submit a request for a card if they do qualify.
On your form, you allow users to enter the area code of their own local office (and based on that area code) review a list of users that qualify for a card. The runtime form is shown in Figure 5-26.
Figure 5-26 Sample Calling Card Request Form
The data in the Candidates Picklist control is populated from the results of a query that is defined as shown in Figure 5-27.
Figure 5-27 Calling Card Queries Definition
The query takes a single input parameter,, for the user-entered area code. The query then searches the entity (in the idmsample-alh container) and returns the users whose telephone numbers do not start with the same value entered in the .
The form has an input field called Figure 5-28.. It is the text field where the user enters the area code of the local office. The properties for OfficeAreaCode are show in
Figure 5-28 OfficeAreaCode Properties
Notice that the Text control defines an Figure 5-29.event. The event fires when the user tabs from the Text control. The event fires the custom event as shown in
Figure 5-29 OnChange Event Properties
Theevent is defined as a property on the Picklist control.
Figure 5-30 Candidates PickList Properties
When the event is fired, the Figure 5-31). This method populates the value of the PickList control with the results of the query called (defined in Figure 5-27). It passes the value of the text field as the query’s input parameter .event performs an action expression that calls the method (as shown in
Figure 5-31 GetCandidates Event