You can Create Post by clicking "Create post" & can reply or put comments for any existing post

74 posts

20 answers

13 comments

5,953 users

Contact me :
Email: dbahossain@gmail.com
Skype: apexexplorer
Phone:+880-1700514916

UpWork Contact Info:
Find Freelancers by: dbahossain
Or
Visit My direct Profile

How to show dynamic error message with field in Oracle apex

0 votes

Hi ALL,

Sometimes we need to show specific error message highlighted with related field item. Below example showing if the user status is inactive during login it will show 'Inactive User' instead of showing 'Invalid login':

declare
 v_user_status char(1):= 'N';
begin
 select STATUS into v_user_status from USER_MASTER where user_name = :P101_USERNAME;

if v_user_status = 'Y' then
  return true;      
else
  apex_error.add_error (
        p_message          => 'Inactive User!',
        p_display_location =>  apex_error.c_inline_with_field,
        p_page_item_name   => 'P101_USERNAME');       
end if;


Note: Make sure you did not put ':' before Page Item to assign value of parameter p_page_item_name You can show your message also dynamic, in that case put your dyanamic message in a variable and place that variable name in the p_message => section.

To show both field and notificaton use  apex_error.c_inline_with_field_and_notif


To show on error page use  apex_error.c_on_error_page

To show only in notificaiton use below:

apex_error.add_error (
    p_message          => 'Inactive User!',
    p_display_location => apex_error.c_inline_in_notification );

asked Feb 20, 2017 in Apex by admin (2,850 points)
edited Feb 20, 2017 by admin

Please log in or register to answer this question.

© 2013 apexexplorer.com. All rights reserved.
...