I have a field where I need to specify a character limit using apaces.
How can I achieve this?
<Field displayName="Account Description" displayType="textarea" helpKey="Enter a description up to 256 characters, including spaces and special characters." name="description" type="string"/>
You may have to use a validation script to ensure that your form field does not get submitted when it has more than the character limit. Here is a working sample for a validation script present on the form field.
<ValidationScript>
<Source>
try {
import sailpoint.object.Application;
import sailpoint.object.Identity;
if(null != accountName && accountName.length() >20){
return "Account Name for AD account cannot be more than 20 characters";
}
if(null != accountName && accountName.matches(".*\\s+.*")){
return "Account Name for AD account cannot have whitespaces";
}
} catch(Exception e){
return null;
}
return null;
</Source>
</ValidationScript>