>> if (form.getValue("UserName") ==" "){

Do you mean this?

if (form.getValue("UserName") =="" ){



And it's always a wise idea to use try..catch

function list()
{
var dn = "";
try
{
dn = form.getValue("UserName");
if ( dn != "" )
return( IDVault.get('FirstName', dn, "user", "FirstName" ));
}
catch( e )
{
alert ( "error getting FirstName for " + dn + ": " + e );
}
return "";
}


Wolfgang






On 15.06.2012 18:36, lvaradha wrote:
>
> I am trying a create a workflow for modifying user
>
> This is my simple form
>
>
> FormField |Data Type |Control type
> -------------------------------------
> UserName | dn | DNLookup
> FirstName |String |Text
>
>
> UserName event property
>
> onchange field.fireEvent("userToModify")
>
> FirstName event Property
>
> userToModify
>
> function list() {
> if (form.getValue("UserName") ==" "){
> }
> else
> {
> var s = IDVault.get('FirstName', form.getValue("UserName"), "user",
> "FirstName");
> return s;
> }
>
>
> }; list();
>
> When i open the form i am getting the error
>
> First Name: An error 'Expected string value for parameter ''dn'' of
> function ''idvault.get()''.' was encountered while executing the script
> 'in IDVault.get()'
> First Name: An error 'Expected string value for parameter ''dn'' of
> function ''idvault.get()''.' was encountered while executing the script
> 'function list() { if (form.getValue("UserName") ==" "){ } else { var s
> = IDVault.get('FirstName', form.getValue("UserName"), "user",
> "FirstName"); return s; } }; list(); '
> First Name: An error 'Expected string value for parameter ''dn'' of
> function ''idvault.get()''.' was encountered while executing the script
> 'function list() { if (form.getValue("UserName") ==" "){ } else { var s
> = IDVault.get('FirstName', form.getValue("UserName"), "user",
> "FirstName"); return s; } }; list(); '
> Select User: An error 'Expected string value for parameter ''dn'' of
> function ''idvault.get()''.' was encountered while executing the script
> 'field.fireEvent("userToModify")'
> Select User: An error 'Expected string value for parameter ''dn'' of
> function ''idvault.get()''.' was encountered while executing the script
> 'field.fireEvent("userToModify")'
> Select User: an error occurred Expected string value for parameter
> ''dn'' of function ''idvault.get()''.. Please contact your system
> administrator. Detailed information can be found in the console.
> Unrecoverable error during asynchronous call
>
>
> Here what i am doing wrong?
>
>