How to send error message to forms from Database Trigger

Hi, Please help me to send error message to forms from Database Trigger?
RgDs,
Madesh.R.M

You are correct, the On-Error trigger is a Forms trigger. However, if your Form is going to display the error generated by the database stored procedure or trigger - you might not see the database error in your Form unless you check the DBMS_ERROR_CODE in the On-Error trigger and manually display the Error Code and associated Text. I've see this happen with a co-worker. The Form she was working on was based on a table with an Before-Insert trigger. Because she was not explicitely handling the error from the Before-Insert trigger in the Forms On-Error trigger, her Form appeared to halt for no reason at all. Once she added code to the On-Error trigger in the Form to handle the DBMS_ERROR_CODE, she discovered the trigger was producing an error and was able to show the error to the user in the On-Error trigger.
I understand the desire to keep as much as possbile in the database, but with that comes some extra coding in your Forms to handle this. This extra coding could easily be placed in a Forms Library, attached to a Form and called in the On-Error trigger. Your code could look like this:
DECLARE
   /*This example assumes you have an Alert defined
      in your Form called: 'ERROR' */  
   al_id    ALERT;
   al_text  VARCHAR2(200);  /* Max text of a Forms Alert message*/
   al_btn   NUMBER;
BEGIN
IF DBMS_ERROR_CODE != 0 THEN
   /* Error code is ORA-00000 Normal Successful completion
       So only handle non-zero errors  */
   al_text := DBMS_ERROR_CODE||':'||DBMS_ERROR_TEXT;
   al_id := Find_Alert('ERROR');
   set_alert_property(al_id, alert_message_text, al_text);
   al_btn := show_alert(al_id);
END IF;
END;Your original question was "How to send error message to forms from Database Trigger?" The answer is you don't because Forms already gets the database error code and database message through the Forms DBMS_ERROR_CODE and DBMS_ERROR_TEXT functions. Look these up in the Forms help and it should clear things up for you.
Craig...
Edited by: CraigB on Jun 14, 2010 4:49 PM
Edited by: CraigB on Jun 14, 2010 4:49 PM
Edited by: CraigB on Jun 14, 2010 4:50 PM
Edited by: CraigB on Jun 14, 2010 4:51 PM
Edited by: CraigB on Jun 14, 2010 4:51 PM

Similar Messages

  • How to display Error Message in APEX from Database Stored Procedure

    Hello,
    Using APEX version 3.2
    DB version 9.2.0.8.0
    Internet Explorer version 6
    I have an After Submit Page Process that calls a stored procedure. In the exception section I'm using dbms_output.putline to display an error message, but the error message is not displayed in APEX. How can I have the error message generated from the stored procedure display in APEX?
    Thanks so much.

    Hi Apex_Noob,
    I created On Load - Before Header process that uses apex_application.g_notification := :P3_ROLE;I'm sorry but I'm not sure what you mean by "instead of using dbms_output.putline use :P1_ITEM"
    I have the following code in my stored procedure
    EXCEPTION
         WHEN OTHERS THEN
         dbms_output.put_line('Role does not exist');Thanks.

  • Best Practices Question: How to send error message to SSHR web page.

    Best Practices Question: How to send error message to SSHR web page from custom PL\SQL procedure called by SSHR workflow.
    For the Manager Self-Service application we’ve copied various workflows which were modified to meet business needs. Part of this exercise was creating custom PL\SQL Package Procedures that would gather details on the WF using them on custom notification sent by the WF.
    What I’m looking for is if/when the PL\SQL procedure errors, how does one send an failure message back and display it on the SS Page?
    Writing information into a log or table at the database level works for trouble-shooting, but we’re looking for something that will provide the end-user with an intelligent message that the workflow has failed.
    Thanks ahead of time for your responses.
    Rich

    We have implemented the same kind of requirement long back.
    We have defined our PL/SQL procedures with two OUT parameters
    1) Result Type (S:Success, E:Error)
    2) Result Message
    In the PL/SQL procedure we always use below construct when we want to raise any message
    hr_utility.set_message(APPL_NO, 'FND_MESSAGE_NAME');
    hr_utility.raise_error;
    In Exception block we write below( in successful case we just set the p_result_flag := 'S';)
    EXCEPTION
    WHEN APP_EXCEPTION.APPLICATION_EXCEPTION THEN
    p_result_flag := 'E';
    p_result_message := hr_utility.get_message;
    WHEN OTHERS THEN
    p_result_flag := 'E';
    p_result_message := hr_utility.get_message;
    fnd_message.set_name('PER','FFU10_GENERAL_ORACLE_ERROR');
    fnd_message.set_token('2',substr(sqlerrm,1,200));
    fnd_msg_pub.add;
    p_result_message := fnd_msg_pub.get_detail;
    After executing the PL/SQL in java
    We have written some thing similar to
    orclStmt.execute();
    OAExceptionUtils.checkErrors (txn);
    String resultFlag = orclStmt.getString(provide the resultflag bind no);
    if ("E".equalsIgnoreCase(resultFlag)){
    String resultMessage = orclStmt.getString(provide the resultMessage bind no);
    orclStmt.close();
    throw new OAException(resultMessage, OAException.ERROR);
    It safely shows the message to the user with all the data in the page.
    We have been using this construct for a long time for all our projects. They are all working as expected.
    Regards,
    Peddi.

  • How ro send error message from BADI to BAPI

    i have a BADI which is triggered from a BAPI.This BADI has only importing and changing parameters.How can i send error message to BAPI.Please reply at the earliest.
    High points can be expected.

    Hi Arshi,
         Please check whether the following link is of any use to you,
    how to capture the error message from bapi
    Best Regards.
    Reward points if it is helpful.

  • Display error message in forms from function "verify_function"

    Hi,
    We have a number of users with our own created profile attached to them.
    We have enabled the 'PASSWORD_VERIFY_FUNCTION' for our own profile.
    Function "verify_function" is used to validate a user's password.
    In "verify_function" we have used "raise_application_error" message in case password validation fails.
    Example:
    raise_application_error(-20001,'Password must be minimum 8 characters in length and maximum 30 characters long');Question) "raise_application_error" displays the error message only in SQL Plus prompt. How do I display the same message from Oracle forms?.
    I have used DBMS_ERROR_TEXT & DBMS_ERROR_CODE in ON-ERROR trigger. This is not displaying the error message in forms in case validation failed in "verify_function". Oracle simply clears the username/password field with a new window. We want to display the error message that occured in "verify_function".
    Thanks

    use the following code in validating the item, e.g when-button-pressed
    begin
    verify_function;
    exception
    when others then
    message(sqlerrm);
    raise form_trigger_failure;
    end ;
    OR
    instead of writing a procedure rewrite it as a function to return 1 if password is correct or 0 if password is wrong
    Regards
    Jihad

  • How to display error messages and output from Matlab (which Matlab would typically send to its command window but no longer does when called by Labview) into Labview or allow it to be dumped into Matlab Command Window?

    Using Labview 6i and Matlab 6.1. I want to be able to see Matlab warnings and error messages either in the Matlab Command Window or in Labview itself. Currently Matlab is called by Labview (which is working). However I would like to debug and/or modify my Matlab script file to better understand how the two programs are interfacing. It is difficult since no data or messages can be displayed currently to the Matlab command window. I would like to change that if it is possible - Labview is suppressing that from happening. If not possible to send these
    messages to Matlab Command Window can I make it at least possible to see Matlab's actual warnings and/or error messages in Labview?

    I don't think you can debug your Matlab script from labVIEW. The following webpage talks about this:
    http://digital.ni.com/public.nsf/3efedde4322fef198​62567740067f3cc/19106e318c476e608625670b005bd288?O​penDocument
    My suggestion would be to write a script in Matlab and thoroughly test it before calling the script from a Matlab script node in LabVIEW.
    Chris_Mitchell
    Product Development Engineer
    Certified LabVIEW Architect

  • How to Add error message for component from the baking bean

    I am in the situation, I need to add the h:message message component for each component at the time I am looking for an easy process something like I have to add the error message at the bean side, here I am using component binding approach but I am not able to add child for input Text components at the bean side, actually my final target is to add the message for each component when ever they get error and I have to change the style also.....
    So please anybody help me......

    Thanks for the response but one more thing right now I can't add message tag for each component so that I can add message from the baking bean as per ur solution I tried like this
    FacesMessage msg = new FacesMessage("Testing is going");
    msg.setSeverity(FacesMessage.SEVERITY_ERROR);
    FacesContext.getCurrentInstance().addMessage(tf_ADD1.getId(), msg);
    it is working but it is showing on the top of the for even no problem but I need to change the component color based on the message but I am not able to achieve that so how can I do that from backing bean now I can't add tags for each component.
    So please show me a way.

  • How to send error message via a mail to the customers email id

    HI experts ,
    i have a requirement,In idoc where i have to send the error message via email to a perticular emailid?
    please help me n tell also which fm is used for that?
    Thanks
    RAhul Sisodia

    Hi ,
    Check this Link..
    [sending an email with multiple attachments;
    Regards,
    Sachin M M

  • How to send a message(apple event) from mac os to our application

    on developer.apple.com i found a method which opens a given documetns through an apple event.
    my question is how to send open document event from mac to our application on xcode

    Assuming you're using Cocoa, the simplest solution is to call -[NSWorkspace openFile:withApplication:]. Example:
    NSWorkspace *ws = [NSWorkspace sharedWorkspace];
    NSString *appPath = [ws absolutePathForAppBundleWithIdentifier: @"com.apple.textedit"];
    [ws openFile: @"/path/to/file" withApplication: appPath];

  • How to send a message to WD from a BPM?

    Hi All,
    I have a ccBPM in which I recieve a binary file .
    On receiving it I want :
    1)To send it to a folder in my pc.
    2)After sending file I need to send a message to WD giving path of file on my system so that it can be UPLOADED to the context.
    Please help !
    Points assured for helpful answers!
    Sumit

    HI,
    See the below links
    /people/arpit.seth/blog/2005/06/27/rfc-scenario-using-bpm--starter-kit - File to RFC  - File to Mail
    /people/michal.krawczyk2/blog/2005/08/22/xi-maintain-rfc-destinations-centrally - Maintain RFC destination centrally
    /people/michal.krawczyk2/blog/2005/03/29/configuring-the-sender-rfc-adapter--step-by-step
    Troubleshooting - RFC and SOAP scenarios-/people/shabarish.vijayakumar/blog/2008/01/08/troubleshooting--rfc-and-soap-scenarios-updated-on-20042009
    XI: RFC or ABAP Proxy ? ....ABAP Proxies with attachments --/people/michal.krawczyk2/blog/2006/04/19/xi-rfc-or-abap-proxy-abap-proxies-with-attachments
    RFC -> XI -> WebService - A Complete Walkthrough (Part 2) -/people/shabarish.vijayakumar/blog/2006/03/28/rfc--xi--webservice--a-complete-walkthrough-part-2
    RFC to SOAP
    /people/shabarish.vijayakumar/blog/2006/03/23/rfc--xi--webservice--a-complete-walkthrough-part-1
    /people/piers.harding/blog/2004/07/18/you-dont-need-to-use-soap-to-keep-your-rpc-clean
    /people/david.halitsky/blog/2006/08/25/soa-vs-rfc-it-doesnt-have-to-be-charles-bronson-vs-henry-fonda
    https://www.sdn.sap.com/irj/sdn/advancedsearch?query=rfc%20to%20soap%20scenario&cat=sdn_weblog
    Regards
    Chilla
    <i>reward points if it is helpful..</i>

  • Error message-retrieve data from database

    I tried to retrieve data from oracle database. I got the following error message. I did compile the files without error. but when I run index.jsp I got the following error message. is it related with taglib Directives ?
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Exception in JSP: /index.jsp:8
    5: <% AccessDB accessDB=new AccessDB(); %>
    6:
    7: <%-- create an instance of List, then retrieve SubjectNames --%>
    8: <% List subjNames=accessDB.getSubjectName(); %>
    9:
    10: <%-- make list accessible to page --%>
    11: <% request.setAttribute("subjNames", subjNames); %>
    Stacktrace:
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    root cause
    java.lang.NullPointerException
         org.AccessDB.getSubjectName(AccessDB.java:68)
         org.apache.jsp.index_jsp._jspService(index_jsp.java:62)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
    Apache Tomcat/5.5.17

    Hi,
    Try to print the value in List...n comment the request.setAttribute...n then run the program....
    check wot value is printed in List....
    This error may b because the List doesnt have anyvalue into it.....

  • How to send short message services(SMS) from PC desktop to Mobile  with the

    sir, i want to know " how we can send the free SMS from PC desktop to Mobiles? this is my project part of final year project and till now i m in confusion. what r the various tools and technologies will be in used for implementing the SMS system. In fact, i m a new user of wireless java. so, pls give ur valuable hands for this topic.

    First of all PC as a "stand-alone" machine does not have ablity to send SMS since there is no necessary hardware in it. You can achive this in two ways: first, connect your mobile (method depends on model) to PC and use it to send SMS. Ofcourse it won't be for free - mobile owner will have to pay for it. Second way involves using so called "SMS gateway" provided by GSM suppliers via internet. Most of them, at least in Poland, are well protected against using by machines.
    This is all I know about it. Hope it helped in some way

  • Is it possible to send error message from Adapter Module to CCMS?

    Hi
    Is it possible to send error message from Adapter Module  to CCMS...?I have written on adatper module from there i have to send error message to CCMS or SXMB_MONI. Is it possible if yes please send me the related documents
    Best Regards
    Ravi Shankar B

    Hi
    I have written following User Defined Exeption in my Module program
    class DuplicateFileException extends ModuleException{
              DuplicateFileException(String message){
                   super(message);
    I am throwing my Exception like this
    try{
         throw new DuplicateFileException("Duplicate File");
    }catch(DuplicateFileException e){
         throw e;
    But i am not getting this exception in SXMB_MONI. In adpater monitoring i am getting the following exceptions
    <b>
    2007-05-16 15:51:30 GMT+05:30: Retry interval started. Length: 5.000 s
    - 2007-05-16 15:51:30 GMT+05:30: Error: java.lang.NullPointerException
    - 2007-05-16 15:51:30 GMT+05:30: An unknown error occured.
    - 2007-05-16 15:51:30 GMT+05:30: Processing started
    - 2007-05-16 15:51:25 GMT+05:30: Error: java.lang.NullPointerException</b>
    can any one give me the idea how to send error from module program to SXMB_MONI
    Thanks & Regards
    Ravi Shankar B

  • When i do initial set up w creative cloud set uo wont run send error message"installer failed to initialize" why and how can i get pass this

    When I do initial set up with creative cloud set up it wont run a send error message "installer failed to initialize" comes up. Why and how can I get passed this?

    Error "Installer Failed to Initialize" | Install desktop application | Windows

  • How to send a message to a Facebook friend from shortcut of messages in notification center

    i tried to send a message to a facebook friend from the shortcut of messages like facebook post or twitter tweat option in notification center but i couldn't i thought there may be something else which i need to do before sending a message to anyone from facebook is there something i need to get done before i can a message to a facebook friend ???

    Hi,
    I take it you have a Jabber account set up in Messages ?
    A Google Mail ID can access Google talk which is a Jabber Server and if you have Enabled "Chat" at Facebook you will have a Facebook chat ID that can be used in Messages as they too run a Jabber server.
    Of course these are just two of many Jabber and compatible XMPP servers.
    I don't have Facebook or Twitter but I did use the Menu bar icon for Notifications  and clicked Messages and Sent a Messages to one of my Jabber IDs (it logged me in and sent it from my Google one).
    In the System Preferences > Notifications I do have Share Button set (Messages only).
    9:04 pm      Saturday; May 10, 2014
    ​  iMac 2.5Ghz i5 2011 (Mavericks 10.9)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad

Maybe you are looking for

  • Can't empty Trash error -50

    Hi, Trust this is the right forum. If you can assist,I would appreciate it.I'm running Mountain Lion on a Mac Pro 1. I get an error -50 trying to empty the trash. 2. The trash is on an external drive (Mac OS Extended (Journaled) 3. The disk utility r

  • Camera says cannot play back image

    Camera says cannot play back image after downloading picutures to computer and placing disk back in camera.  It is a Cannon EOS 50D.  I cannot find the instruction manual.  What do I need to do to fix this problem so that I can view pictures on camer

  • LR2: export jpg sRGB vs. print to jpeg sRGB - Same colors in MS explorer preview?

    Hello ! Im using LR2 and do have problems understanding why "printing" to jpeg and exporting to jpeg give different results (colorwise) in the following case: The first picture was exported using "jpeg" file format and "sRGB" color space. The second

  • Form submit on image click

    I am having trouble with a image submit button.  here is my code: <form action='' method='post'><input type='image' src='http://www.mysite.com/images/star.png' width='20' height='20' title='Click to unstar this message' name='unstar' id='unstar' /></

  • Using workflow in DMS

    Hi. I have several questions about using workflows with DMS. I want to implement an approval workflow. - Is it possible to fix the next status of the document if somebody doesn't approve the workflow? - Is it possible to manage distribution lists whe