Search code examples
javascriptoracle-apexoracle-apex-5.1

Oracle APEX Warning Message


I want to create warning message exactly as success.

APEX has the default success message:

apex.message.showPageSuccess('OK');

enter image description here

So, instead of this success message, i want to create a warning message like this: enter image description here

when &AMELIA. < 0.

(AMELIA is an application item).

Now i am using apex.message.alert but it's not the same, because this alert is different: enter image description here

Can someone help me to create a warning message instead of this black alert message?


Solution

  • Paste the below code in the Function and Global Variable Declearation section

    function show_notification(Msg){  
            apex.message.showPageSuccess(Msg); 
            $('#t_Alert_Success').attr('style','background-color: #ffe5ad;');
            $('.t-Alert-title').attr('style','color: black;font-weight: bold;');
            $('#t_Alert_Success div div.t-Alert-icon span').removeClass('t-Icon').addClass('fa fa-warning');
    }
    

    How to use:

    For example:

    1. Create a button.
    2. Create a Dynamic Action on click of the button
    3. Create a True Action and select Javascript Code call the created JS function(shown below)
    show_notification("Your Message");
    

    NOTE: The color and icon can be changed as per the requirement