Forum Stats

  • 3,874,157 Users
  • 2,266,675 Discussions
  • 7,911,745 Comments

Discussions

Validation message displayed twice

MarcLaf
MarcLaf Member Posts: 182 Bronze Badge

Hi,

I have a form with a POST command. As I understand the POST command will do ALL validation in the form.

My problem is that on a commit I POST and then I commit. So my error messages from the validation (PRE INSERT BLK LEVEL) gets displayed twice. Once in the POST and the other from the COMMIT FORM.


Is there a way to ONLY display the error messages (from validation) ONCE?


Thanks in advance,

Marc L

Comments

  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 7,487 Employee

    Need more details, including the Forms and DB versions you are using.

    Are you using Forms blocks based on DB (i.e. "Data Blocks") or you are executing your own DML and populating (and altering) fields or both? And, how are you "committing" (COMMIT_FORM, or Save button or something else)? Be specific; if you are executing the "COMMIT" - are you using COMMIT or COMMIT_FORM?


    Michael Ferrante

    Senior Principal Product Manager

    Oracle

    Twitter: @OracleFormsPM

  • MarcLaf
    MarcLaf Member Posts: 182 Bronze Badge

    Using Oracle Forms 12c and Oracle DB 19. Yes, I'm using data blocks, based on tables from DB. User clicks a button to save and I'm doing a COMMIT_FORM.

    Thanks,

    Marc L

  • MarcLaf
    MarcLaf Member Posts: 182 Bronze Badge

    Here's part of my Key-Commit code:

    Marc L

  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 7,487 Employee

    Hmmm - If you are using a true "data block", there is often little reason to execute your own POST. Forms will do this automatically as soon as a the first change is made. This will result in a record lock. I'm not saying that doing a POST (or COMMIT_FORM) is a bad thing. I'm just saying that in a block managed by Forms, most of the "right" processing will happen automatically (a benefit of using Forms).

    To your question, I have not tested, but suspect the behavior based on your description of what you are doing, is correct. Validation must occur upon POSTing, but also again when COMMITing. If you look at the Builder Help related to POST and COMMIT_FORM you will see that it supports this belief.

    If you wanted to continue on this path, it might help to change the Validation Unit property (form level), as this might offer some relief. Of course doing this could also change the desired behavior of something else. Again, check the Builder Help for details on this property.


    Michael Ferrante

    Senior Principal Product Manager

    Oracle

    Twitter: @OracleFormsPM

    MarcLaf