Prevent a User from Entering Wrong Data | How to Reslove

By Jag - August 07, 2014
If data entered into Oracle is wrong then the processes which use this data will also give incorrect output or will end with an error. I have had problem with users who have been asked not to enter semi colons or spaces in the email address field while sending the PO for approval. As per the process if semicolons or spaces are entered the custom PO workflow will not raise an error but the email notifications will not reach the intended recipients.
I needed to prevent the users from entering semi colons or spaces by mistake. So I created a form personalization so that Oracle displays a popup error message and stops further processing until the user corrects his entry.
Form personalization does not have WHEN-VALIDATE-ITEM as it is available for a form. If I have to use this option then I have to resort toWHEN-VALIDATE-RECORD trigger. This trigger will fire when the user has entered the values within a form block and clicks outside the block. Oracle will validate the data as per the personalization and raise the conditions if those are met. We have used a message type Error, which will not allow the user from going ahead as it always raises an error condition on the form.
Personalization step
Open PO form. Click on Help > Diagnostics > Custom Code > Personalize
Create a new personalization
Seq:
Description: PO EMail address check
Level: Function
Condition tab
Trigger Event: WHEN-VALIDATE-RECORD
Trigger Object: PO_APPROVE
Condition: INSTR(${item.po_approve.email_address.value}, ‘;’) > 0 OR INSTR(${item.po_approve.email_address.value}, ‘ ‘) > 0
Actions tab

Seq:
Type: Message
Description: Ask user to correct email
Language: All
Message Type: Error
Message Text: The email address(s) should not contain ; or spaces
The important point to note here is the message type. When we use a message type as Error then the user will not be allowed to proceed working on the form until the condition is corrected. The condition is what we have entered on the Conditions tab earlier.
Usage
This is how it will work.
Create a new PO
Send the PO for approval by clicking on Approve button.
To send the PO to the supplier after approval automatically check the box named E-Mail.
Now enter the email address(s) where the PO needs to be sent after approval.
Enter email addresses separated by a semicolon and a space.
Press OK.
Oracle will prevent you from sending the PO for approval until you remove the semicolon (;) and/or the space
  • Share:

You Might Also Like

0 comments