How to restrict the number of error messages appearing in af:messages

Hii all....
Ihave customized the error messages which are produced when a constraint in a database are voilated using the following links
http://download-west.oracle.com/docs/cd/B32110_01/web.1013/b25947/web_val.htm#CIHJBIDJ
and by overriding the ListResourceBundle using the following link:http://one-size-doesnt-fit-all.blogspot.com/2007/05/dont-constrain-yourself-displaying.html
Now my problem is say, when a primary key is voilated i get repeated error messages and some unwanted error messages like 2,4(which are again repeated) as show below:
1.Empno - Employee Already Exists!!!
2.Empno - Attribute Empno in AppModule.EmpVO1 is required
3.Empno - Employee Already Exists!!!
4.Empno - Attribute Empno in AppModule.EmpVO1 is required
Now, i want the user to only see error numbered 1 and rest 2,3,4 should not be displayed on the screen ......plzzz knidly help me.

Hi,
In your ErrorHandler, override the method getDisplayMessage and in it add whatever message you'd like. Something like this:
    @Override
    public String getDisplayMessage(BindingContext bindingContext, Exception exception) {
        FacesContext fctx = FacesContext.getCurrentInstance();
        Iterator<FacesMessage> iterator = fctx.getMessages();
        if (exception instanceof JboException) {
            // do something (or nothing)
        } else if (exception instanceof UniqueNameException) {
            // add some message
            if (!iterator.hasNext()) fctx.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "", "This is an UniqueNameException!");
        return null;
{code}
You can also try add some code to manipulate the iterator and remove all the messages, and then add only the one you want the user to see.
Pedja                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • How to restrict the number of Records into the Table?

    Is there any way that I can restrict the number of records can be entered into the table?
    For example I have created a table TAB1 with size category 0( zero).
    User dont want to enter more than 100 values, How to restrict the number entries? Whether Basis can do it?
    Regards,
    Prathap

    Hi Prathap,
    You can write a code in table maintenance events to restrict the number of Records added into the Table to constant.
    Solution:
    Se11 -> enter table name (TAB1) -> F6 -> Utlities -> Table maint. generator -> Envirnment -> modification -> events -> write here the form routine name.
    Double click on routine name. You will get into include section of the code. Write here code like:
    IF current_rec_num > 100.
       messgae error 'Entry restriceted to 100'
    ENDIF.
    Somewhat this way you can achieve your target.
    Regards,
    Sachin

  • Restrict the number of processed messages in a time interval

    Hi experts,
    i have one problem to solve.
    Is there a possibility to restrict the number of processed messages in single stack java pi 7.3 in some time intervals?
    My problem is, that i have to restrict the messages from being sent only from 8:00 to 18:00 and there are restricted numbers that i can send in 15 minutes.
    For example 2000 messages can be sent in 15 minutes, if more messages arive, they should be queued and be processed in the next 15 minutes.
    Thank you in advance.
    Richard

    You're right in thinking that the behaviour you describe looks wrong.
    Take a look at the QueueBrowser interface which can be used to inspect a queue. You get one using QueueSession.createBrowser(Queue). The QueueBrowser allows you to scan a queue without consuming the messages. However note that the state of the queue may change while you're observing it through the QueueBrowser so what you see might not always be a 100% accurate representation of the queue at any given time.
    Other things to check:
    - message selectors - are you setting a message selector on your queue receiver which is resulting in not all of the messages 'matching'.
    - expired messages - are you setting a time-to-live on the messages that you publish.
    Hope this helps,
    David Ingham
    http://www.arjuna.com

  • How to restrict the number of login attempts?

    Hi,
    Is there any "out of the box" solution to restrict the number of login attempts
    in personalization server?
    Thanks

    why is it obvious he wants to restrict instances
    of program, rather than instances in
    it? it's not obvious, but it's what I think he meant
    he asked "how to restrict the number of instances in
    a program". it has the words "instances" and
    "program" in it, but not the word "class". on face
    value, yes, he's asking about instances within one
    JVM. knowing a bit about how newbs minds work, I'm
    reading between the lines and I reckon he meant
    instances of his program. had he meant
    "instances of classes" he'd have said so. "instances
    in a program" sounds like somebody more experienced
    talking, which if he was, he'd know how to do limit
    either instances of classes or instances of
    his program, and wouldn't be asking. I could be
    totally wrong, but I don't think I am; that's what I
    inferred from his post. only the OP knows for sureInteresting.
    The OP also said "to any number". So you were guessing that this particular user wants to only permit, for example, five instances to be run on any one box at one time?

  • How to restrict the Number of attachments

    Hi All,
    I would like to restrict the Number of Attachments,
    I found many threads on how to restrict the size on the attachments.
    Is there any standard way(profile or setup) to restrict the number of attachments
    Other Option is
    When the user try to add attachments, I need to get the Entity, PRIMARY key and
    query FND_ATTACHED_DOCUMENTS count and through an error message.
    Not sure how easy it is.
    If anybody tried this requirement please share the logic to achieve the same.
    Thanks,
    With Regards,
    Kali.

    Hi All,
    I have achieved using the below logic, in the ProcessFormRequest,
    String eventParam = pageContext.getParameter(EVENT_PARAM);
    if("oaAddAttachment".equals(eventParam))
    String pkValue = pageContext.getParameter("PKEYID");
    String attachmentCountQry = "SELECT count(*) FROM fnd_attached_documents WHERE entity_name = <EONAME> AND pk1_value = "+pkValue ;
    //Execute the query and get the count,
    int attachmentsCountInt = executeQuery(attachmentCountQry );
    if(attachmentsCountInt >=2)
    throw new OAException("Add only 2 attachments");
    With Regards,
    Kali.

  • How to restrict the Number of sales orders in theTCode:VL10A whil creation

    I'm creating the Delivery by using the batch job with program: RVV50R10C Here I need to restrict the number of sales orders numbers while creating deliveries for sales orders
    Like system should pick the sales orders (sales documents) from 1 to 100 OR 100 to 200
    Please advise me how to do it and what changes I need to do it

    Hi,
    Aslo, you can see Note 198137 - VL10: Customer-specific enhancements / user exits. As is for SO, check subroutine LV50R_VIEWG03. If cf_subrc = 1 thin this SO isn't seen in list.
    ***INCLUDE LV50R_VIEWG03 .
    *&      Form  POSTAB_VEPVG_FILL_USER
    FORM POSTAB_VEPVG_FILL_USER
         USING    IX_LIST_PROFIL    TYPE      SHP_VL10_LIST_PROFIL
                  IX_PARAMETERS     TYPE      SHP_VL10_PARAMETERS
                  IX_SELECT_OPTIONS TYPE      SHP_VL10_SELECT_OPTIONS
                  IT_ENQUEUE        TYPE      SHP_VL10_PACKAGE_T
                  IX_SD_ORDER       TYPE      SHP_VL10_SD_ORDER
                  IS_VEPVG          TYPE      VEPVG
         CHANGING CS_POSTAB         TYPE      SHP_VL10_ITEM
                  CF_SUBRC          TYPE      SYSUBRC.
    CF_SUBRC = 0.
    *  cs_postab-zzfield = ......              "add new field to List
    *  if xxxxxxx = yyyyyyy.
    *    cf_subrc = 1.                         "Exclude this index from List
    *  endif.
    ENDFORM.                    " POSTAB_VEPVG_FILL_USER
    I hope this helps you
    Regards
    Eduardo

  • How to restrict the number of items in Sales Contract - QCTR

    Hi,
    Is there any standard way or BADI exit to restrict the number of items  in the Sales Contract?(QCTR). I want to restrict number of items in the Sales Contract. Ex - Contract A - Max of 10 ITems(Materials); Contract B - Max of 20 Items(Materials).
    Thanks in advance.,
    Robin

    you can use ORDER_SAVE badi and check before method you can use CRM_ORDER_READ FM and count line items , if count is more than allowed number you can raise RAISE DONOTSAVE exception and issue a message to user. hope it helps you.

  • How to find the number of pending messages in a Queue

    All,
    Is there a way to find the number of pending messages in a given QUEUE to be picked by the queue reader?
    My reader is not picking all the messages as many sent by my writer, i am not sure where they are getting lost? or if the JMS implementation is buffering them and does not flush until it does not have enough to throw out ( which any way does not make sense!!).
    Please help.
    Chandra

    You're right in thinking that the behaviour you describe looks wrong.
    Take a look at the QueueBrowser interface which can be used to inspect a queue. You get one using QueueSession.createBrowser(Queue). The QueueBrowser allows you to scan a queue without consuming the messages. However note that the state of the queue may change while you're observing it through the QueueBrowser so what you see might not always be a 100% accurate representation of the queue at any given time.
    Other things to check:
    - message selectors - are you setting a message selector on your queue receiver which is resulting in not all of the messages 'matching'.
    - expired messages - are you setting a time-to-live on the messages that you publish.
    Hope this helps,
    David Ingham
    http://www.arjuna.com

  • How to restrict the number of batch jobs used by middleware?

    Hi,
       I'm using middleware to replicate data which send IDOCs from one system to another. I know on source system, I can use SMQS to restrict the number of connections. But on target system, can I use any tool to restrict number of batch jobs? Because every time when replicating data, all batch jobs are occupied.
       Thanks a lot!

    Priya:
    It is likely that the BLOB content defined in your table is being stored 'Out-of-Line'. This means that the LOB columns are stored in segments of their own. These then are the segments that may need shrinking.
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14249/adlob_tables.htm#i1006363
    Varad

  • Sql Server 2008 Reporting Security issue ( added name to Server, some how cannot acces the report ) getting error message

    have added name to Sql server , users cannot access the report, getting error message ,
    I have give all the permission to this users, so why this users still cannot look at the report,
    and getting error message,
    An error has occurred during report processing.
    cannot create a connection to data source Ax live
    for more information about this error navigate to the report server on the local server machine or enable remote errors.
    can some please help me what this message means,
    I really appreciate it
    thanks In advance

    If "Credentials supplied by the user running the report" is selected, when the report is run, the user will be prompted to provide credentials.  They would need to provide credentials that have the appropriate permissions (e.g., read, execute) to the
    database.  This prevents the double hop.
    If "Credentials stored securely in the report server" is selected, you have to enter the username and password of a user (or service account) that has the appropriate permissions (e.g., read, execute) to the database. When the report is run, SSRS will use
    these stored credentials each time to authenticate to the database engine and query the data.  Users running the report are not prompted to provide credentials.  With this option you can use an Active Directory or SQL Server account.
    In order to access/run the report, a user will need to authenticate to SSRS.  There are options here as well. You can provide them the link to the report manager and they can authenticate, navigate to, and run the report.  You can also provide
    direct links to reports that users click in a document or application.  At this point the user is typically still prompted to authenticate to SSRS.  You can also programmatically call the report using API's and essentially build a proxy that authenticates
    to SSRS and open the report.
    Not sure if that answers your question.

  • How to restrict the number of FULL synchronization?

    Hi I would like to restrict the full synchronization (less than 5 FULL synchronization).
    How can I do?
    In which table i can check out?
    Thanks for your answer

    If the client syncs in high priority mode, complete refresh publication items will be bypassed. Also, there is a column in c$all_client_items, CRR, that is set to 'Y' if a complete refresh has been requested.

  • How to change the number for my messaging

    I have 3 numbers on this account but when I go to my messaging to see the messages I can only view from one number. How do I add the other 2 phone #'s to send and receive msgs on My Verizon?

        Hi MichaelRas!
    I apologize for the confusion! In an effort to see the messages sent and received, you'll have to individually log into each number.
    Thanks,
    AyaniB_VZW
    Follow us on Twitter @VZWSupport

  • How to restrict the number of client connections.

    Dear All,
    I have an Oracle Database version 9.2.0.1 in a Windows server 2000. I created a database users “prod1” in this database. It’s a 10 member team. I have to make changes so that, at a single point of time there should be only 2 members connected to the database simultaneously using the id “prod1”. How do I perform this request?
    Thanks in advance
    With Regards,
    Santhosh

    Create a profile with session_per_user (concurrent session) as needed and then assign this profile to prod1 user, in your case.
    CREATE PROFILE "REST_USERS"
    LIMIT SESSIONS_PER_USER 2
    alter user prod1 profile rest_users;
    Parameter RESOURCE_LIMIT must be set to TRUE in the init.ora file.
    Jaffar
    Message was edited by:
    The Human Fly

  • ATG ID Generator, how to restrict the number of digits

    Hi,
    I have a requirement to generate IDs those has 6 digits. None of the ids should contain more than or less than 6 digits. How can I limit this using ATG id generator?
    If I give my seed as 100001, then will it start generating numbers greater than this value? Is there any OOTB method to give a maximum value? Or should I need to override the postGenerateLongId() to give a max check?
    Please advice.
    Thanks,
    R

    Hi Rajeev,
    This is not recommended. ATG GSARepositories do not work tend to work with a limited id space; nor do they help to generate ids within such a limited space. GSARepositories tend to "waste" ids. Basically, they do not support a realistic limit on the id space.
    You may want to consider making a new property to represent this limited id value for presumably a 3rd party system with stricter limits on ids. And allow the GSA items to have their own separate id generated by the IdGenerator (configured normally).
    If you were to attempt to generate 6-digit ids using the IdGenerator, you would obviously have to tweak the seed value and will want to shrink the batch size, potentially all the way down to 1 (which would force it to go to the database for every single id -- a potential performance issue). This is to keep ATG code from skipping ids and using up your id space too quickly. ATG would also use up the ids in any transient items that are discarded without being persisted, so there's no guarantee of consecutive ids for the persisted items. But if you can get all this work sufficiently and aren't creating too many items, you might be able to get it to work. There's no way to set an upper limit on an IdGenerator, but that's not pertinent. If you ever reached the upper limit, this whole scheme will breakdown regardless of what you do. That's why I strongly discourage you from doing this; especially for the actual repository id.
    Your best best may be to write custom code to do this using a property separate from the repository id, and then you can ensure all your criteria are met.
    Thanks.
    Nick Glover
    Oracle Support for ATG Products

  • How to configure the number of icons to appear on the grid?

    Just curious. Is there a way to configure the Application Grid on my leopard dock such that it displays the applications in a X by Y number of icons. Thanks.

    The Dock itself displays only a single line of icons either across the bottom or down the side of the screen. If you have too many icons to fit neatly a couple options exist.
    1) Some people put aliases of their applications into a folder (or more than one) and then place the folder(s) in the Dock. By clicking on the folder you can see what's inside and launch a program.
    2) There are a couple programs that extend the Dock. Some let you swap Docks with a keypress or mouse click and others are programs that launch quickly from the Dock.
    3) Dock alternatives exist as well. I use a program called DragThing - it is a Dock on steroids and does exactly what you want - puts programs in a grid. It doesn't replace the Dock, I just keep the Dock hidden and pretty much pretend it doesn't exist.

Maybe you are looking for

  • Select schemas from relational model on import from data dictionary option

    Hi All, I have one relational model with 3 diferent schemas, I want to compare one of my schemas with the data dictionary I have in a database, I select the import option in the general file menu, select from data dictionary option, select the connec

  • Validation error message in popup

    Hello, I want to ask if it's possible to display validation error message in a popup window/box? I have searched the forum but couldn't find specific solution. Thank you in advance.

  • Keynote action "Move" in iBook problem or limitation?

    Hi, I have ran into a problem with getting a Keynote animation to play correctly in iBook. The Keynote file contains a couple of "move" actions whereby an oject follows a particular path. This is replicated three times on the same slide with similar

  • Can anyone help with a method to ignore GR Processing Time during STO Creation?

    On my current client, we have a unique business scenario where we need to maintain GR processing time to reflect "incubation or hold" time for products after production. It is absolutely necessary that the products should not be available to ship to

  • Retrieving messages from MQ Series

    Hi, We have the situation where we need to receive messages from our partner, who only can use MQ Series to send them. So we are looking into ways how to solve it on our end, which is on a Unix server. We will only read messages, and the other side w