Skip to main content

NetIQ IDM - How to validate form field based on the Regular Expression (validation mask) in NetIQ Userapp workflow forms


Workflow forms in the  NetIQ Userapp provides to validate input fields using regular expression.

Here is the recipe:

Example allow only alphabets and spaces in the form field.

1. On the form field, Add regular expression validation mask:

^[a-zA-Z ]*$

2. On the form field, Add event (OnChange)

3. Add following code on the Event handler:


/*
Function to validate with mask (default) and set new
message if not valid returns true if field valid, else false
*/

function validateField() {
// check if field is valid, by calling default validation,
//which uses the mask

if (field.validate()) {
// not valid
form.clearMessages(); // get rid of the default
// validation mask message

form.showError("The entry " + field.getValue() + " is " +
"not valid");
return false; // field not valid
} else {
// valid, clear old messages
form.clearMessages();
return true; // field is valid
}
};

if (field.getValue() != ""){
validateField();
}

Comments

Popular posts from this blog

NetIQ IDM - JDBC statemens using policy builder

Few examples of using JDBC statements using dirxml policies On the Output policy: Handling matching policies with operation-data support: < rule > < description > [DB] Convert Query to DDL doc </ description > < comment name = "author" xml:space = "preserve" > Maqsood Ali Bhatti </ comment > < comment name = "version" xml:space = "preserve" > 5 </ comment > < comment name = "lastchanged" xml:space = "preserve" > Dec 20, 2017 </ comment > < conditions > < and > < if-operation mode = "case" op = "equal" > query </ if-operation > </ and > </ conditions > < actions > < do-append-xml-element expression = ".." name = "jdbc:statement" /> < do-append-xml-element expression = "../jdbc:statement[las...

NetIQ IDM - Strip unwanted group member values from current operation

This code example shows how to remove unwanted group members from current operation based on some business logic. Optimization group members add to avoid  "ALREADY_EXIST_VALUE" kind of errors. when IDM engine fails to do so. Here I am doing look up in AD for members, and for each added member from IDM if user is already member of AD group, i am just striping out current member value from the current operaiton. < do-set-local-variable name = "group-dn" scope = "policy" > < arg-string > < token-src-dn /> </ arg-string > </ do-set-local-variable > < do-set-local-variable name = "group-members" scope = "policy" > < arg-node-set > < token-dest-attr class-name = "Group" name = "Member" /> </ arg-node-set > </ do-set-local-variable > < do-trace-message > < arg-string ...

NetIQ IDM - SOAP driver -- Handling SOAP service response and manufacturing user association without XSLT

Always pain working with SOAP service and its handling of service response on Query(matching) for user to work with matching policies? Here is the quick wins; without reading  those long lengthy & boring useless SOAP driver blog series at netIQ forums; 1. Make sure you have mapped User class in the schema map with some service attributes 2. Make sure Input and Output policy is registered with all the namespaces you have in your request/response soap messages, example <policy xmlns:soap="http://www.w3.org/2003/05/soap-envelope" 3. I have added operation-data (which is being generated from the Output policy) as part of the SOAP query, but you can skip it if you do not need this. src-dn and association are important to indicate engine for building association.  Operation data will help you to identify operation type and you can carry actions according to it. Inject this on Output ( To support user matching) to send service request: < rule > ...