I recently posted an article how to incorporate your own password policy in Oracle eBS – see here. In the example the validate function in the Java class did a number of validations on the user password. When a validation fails the system generates a message code which is added to the error stack.
Below a small snippit from the Java class I created.
if(!validateLettersAndDigits(password))
{
m_errorStackMessageName = "PASSWORD-INVALID-LETTER-NUMBER"; /* password should contain numbers and letters */
return false;
}
if (!validateUpperAndLower(password))
{
m_errorStackMessageName = "PASSWORD-INVALID-UPPER-LOWER"; /* password should have upper and lower letters */
return false;
}
if (!validateMeta(password))
{
m_errorStackMessageName = "PASSWORD-INVALID-NO-META"; /* password should contain at least a meta character */
return false;
}
if (!validateDictionary(password))
{
m_errorStackMessageName = "PASSWORD-INVALID-DICT"; /* password should not be in the dictionary */
return false;
}
if(!validateNoUsername(username, password))
{
m_errorStackMessageName = "PASSWORD-INVALID-USERNAME"; /* password should not contain the username */
return false;
}
Codes like PASSWORD-INVALID-LETTER-NUMBER and PASSWORD-INVALID-NO-META are message codes. In the Java class from the previous article function getErrorStackApplicationName() returns “FND” meaning we’re raising Application Object Library messages in our custom Java class.
When we load our Java class to the system and reference it in profile option Signon Password Custom the system generates a popup (in Forms) or a message (in OA Framework) when an invalid password is entered.
For example the error in the Change Password page…
and the one in Forms…
Of course we want to present the user a more meaningfull message telling what is wrong with the entered password. We can do this by adding Application Messages to the system. The option is available within responsibility Application Developer and menu Application – Messages. The message codes you have raised in your Java class should be added as a message and a message text should be assigned. This message text is presented to the end-user. Application messages are language driven thus derived based on the selected application language in the Login form.
In this case the application message must be assigned to application Application Object Library (FND) as this was the Error stack application name we used in our Java class.
As a Name you must enter the same code as raised in your Java class (i.e. PASSWORD-INVALID-NO-META).
In field Language select one of the languages used with your system (add messages for all installed languages).
Select Application Application Object Library.
Type and Log Severity should be Error to be consistent in displaying the type of message.
In Current Message Text you enter the text that should be displayed to the user when the message is raised.
When you’re done with adding your custom messages a concurrent program with name Generate Messages must be run to add the messages to the library. This concurrent program can be started also from responsibility Application Developer.
This must be done for every language for which you’ve added messages. Your custom messages should now be displayed to the user. A bounche of Apache may be needed to show the messages in OA Framework.
Thanks a lot.Learned so much from the article.
by the way I wanna know what I shall do if I want the message to be displayed by “ERROR” but not “NOTE”?