Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Execute Validation only when page item changes

PhilMan2Sep 15 2017 — edited Sep 19 2017

Hello.  I'm using Apex 4.2 and Oracle 11.g.

I have an app tracking names and eMail addresses of members.  I created an Edit screen using the Form On A Table With Report.  It's working fine.  A simplified version of the table is below:

prim_keyfirst_namelast_nameemail_address
1JohnDoejdoe@domain.com
2JeffJonesjjones@domain.com
3JoanSmith-Jonesjsmith@domain.com

I also created a validation to prevent a user from creating a new row where the value in email_address already exists.

Type:     Not Exists

Validation Expression 1:     Select 1 from MAIL_RECIPIENT where email_address = :P38_email_address;

Associated Item:     P38_EMAIL_ADDRESS

When Button Pressed:     CREATE

I'd like to do something similar for a SAVE.  For example, if someone were to make a data entry error and update the existing Joan Smith-Jones member and attempt to change the eMail address to "jjones@domain.com", I'd like a validation to provide a warning and prevent the update.  I tried to look through the validation types to see if a validation could be fired only when a particular page item (e.g. P38_email_address) was changed, but I couldn't figure out how to do that.  The best validation message would say something like "That email Address is already associated with Jeff Jones.  Please maintain only one email address per member."  But I don't know how to select the first_name and last_name values in a "Not Exists" validation.

Of course, if someone were to attempt to update the First name of John Doe to Jeff, that would be fine.

Thanks for looking at this.

This post has been answered by -W. on Sep 18 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 17 2017
Added on Sep 15 2017
5 comments
1,922 views