Tuesday 10 December 2013

User Creation - From Personalization To Avoid Special Characters.

Open User Creation Form , Querry any one of the existing Username.Then Go to
Help => Digonostics => Custom Code => Personalize


Create one function as below :
=========================

seq: 1
description : Avoid Specila Characters in USERNAME.

Create Condition :
=============

Trigger Event :WHEN-NEW-ITEM-INSTANCE
Trigger Object :USER.USER_PASSWORD
Condition :
:USER.USER_NAME like ('%#%') or
:USER.USER_NAME like ('%@%') or
:USER.USER_NAME like ('%!%') or
:USER.USER_NAME like ('%$%') or
:USER.USER_NAME like ('%^%') or
:USER.USER_NAME like ('%&%') or
:USER.USER_NAME like ('%%%') or
:USER.USER_NAME like ('%*%') and ${item.user.user_password.navigable.current}='TRUE'

Processing Mode : Both.







Now Create Actions For the True Condition :
======================================
seq : 1
Type : Builtin
Language : All
Built Type : GO_ITEM
Argument : USER.USER_NAME

seq: 2
Type :Message
Language : All
Message Type : Error
Message Text : Username Should not Contain Special Characters like !,@,#,$,%,^,&,*.




Save.
Open New User Creation Form and try to create user with special characters.
It Throws Error : Username Should not Contain Special Characters like !,@,#,$,%,^,&,*.
when cursor is navigated to password field after entering the username.

No comments:

Post a Comment