Old and new values in Oracle Form
Asked Answered
G

1

7

I'm working with Oracle Forms. I have a field named SOLD_TO_CUST_PARTY_NAME. I have to execute a process if I detect a change in the field's value. I tried using when_validate, but it's executed even if you just click the field and move to another field (validation ALWAYS occurs whether you change the value or not). Is there anyway I can check :old and :new or something similar to execute a process only if the field is modified?

EDIT: Can't use personalizations. It has to be done with pl/sql.

Goad answered 26/9, 2012 at 17:5 Comment(1)
when-validate will fire only if there's a change, not otherwise. Something's clearing your item and repopulating it againQuintonquintuple
D
10

There is a property called database value that let you check if the field has been modified and if it has not you just have to exit the validation trigger.

Ex.

    BEGIN

    IF :BLOCK.ITEM = GET_ITEM_PROPERTY('BLOCK.ITEM', database_value) THEN
     RETURN;
    END IF;

     /* VALIDATION */

    END;
Dolphin answered 26/9, 2012 at 19:43 Comment(1)
I guess this construct is used to also handle null values. A simple IF :BLOCK.ITEM != GET_ITEM_PROPERTY('BLOCK.ITEM', database_value) THEN /*VALIDATION*/ END IF; wouldn't handle those.Okeefe

© 2022 - 2024 — McMap. All rights reserved.