The information in this article applies to product: e-Work 6.x
Issue
Using %LDAPSearch with an alias in a list field's 'List options' property will fail when the form loads although no warning is given when publishing.
For example, the following is specified in 'List options':
%Replace(%LDAPSearch(eworkAD,"cn=\*","cn",0),%NewLine(),%Chr(44),0), where 'eworkAD' is the alias specified in a library.
At runtime, the form will fail to open and the following error message is written to the 'Details' section of the Designer log:
Incorrect number of function parameters specified. The number of expected parameters was '6-8'. Procedure LDAPSearch call failed.
Resolution
- This is a known issue.
Here are 2 workarounds:
Create a variable and assign the data for the list to it. This could be done 'When user loads form' or 'When action started'.
For example:
%ListVar:=%Replace(%LDAPSearch(eworkAD,"cn=\*","cn",0),%NewLine(),%Chr(44),0)
Then, in 'List options' for the list field, enter %ListVar.
Don't use an alias. Provide the full LDAP connection details in 'List options'. In place of the code given above, the following, given the appropriate connection string, would successfully populate the list field with a list of common names (cn), each on a separate line:
%Replace(%LDAPSearch("LDAP://ADserver:389","cn=users,dc=metastorm,dc=com","cn=Administrator,cn=users,dc=metastorm,dc=com","password","cn=\*","cn",0),%NewLine(),%Chr(44))
Note that this code will generate the following warning, which should be ignored, when the procedure is published:
The function "LDAPSearch" has the wrong number of parameters. Expected - 4. Found - 7