How to validate not null values for an item in when-validate-item through Program Unit [message #148223] |
Wed, 23 November 2005 03:22 |
sharan_it
Messages: 140 Registered: July 2005 Location: Chennai
|
Senior Member |
|
|
I need to check whether item have null value while inserting,through when-validate-item.
I wrote a Program Unit named CHECK_NULL (To check whether item have null values while inserting)
PROCEDURE CHECK_NULL(ITEM CHAR) IS
ERROR_ITEM VARCHAR2(50);
CURRENT_ITEM_LABEL VARCHAR2(100);
BEGIN
IF ERROR_TYPE='FRM' AND ERROR_CODE='40202' THEN
ERROR_ITEM:=:SYSTEM.TRIGGER_ITEM;
CURRENT_ITEM_LABEL:=GET_ITEM_PROPERTY(ERROR_ITEM,PROMPT_TEXT);
MESSAGE(CURRENT_ITEM_LABEL||' '||'cannot be empty');
RAISE FORM_TRIGGER_FAILURE;
ELSE
MESSAGE(ERROR_TEXT);
END IF;
END;
I kept Required Property as 'Yes' for PVIR_N_REQUESTER.
And am calling that Procedure in When-Validate-Item of a Item
PVIR_N_REQUESTER as
CHECK_NULL(:PVIR.PVIR_N_REQUESTER);
Both compiled sucessfully.
And if I give null value and press Tab, it gives error as
FRM-40202:Field must be entered.
That means this coding not working....Why its not working??
I attached that screenshot also..
Note: Earlier I kept Required Property as 'No' for PVIR_N_REQUESTER,then I changed it into 'Yes'.
If I kept it as 'No' it wont work??? Even I changed it as 'Yes' also is not giving expeced result.
Pls...experts tell me
-
Attachment: screen.doc
(Size: 78.00KB, Downloaded 1322 times)
|
|
|
|
|
|
|