Question

I have a complex form in Oracle Forms that have some recalculation logic in the When-Validate-Item trigger. My problem is that I want this logic only to be executed when the user have changed the value of the item and not when it is changed programmatically as in populating the item at form startup. Naturally I could add some state logic to prevent the programmatically prevent the validation logic at form startup but that will add some extra complexity to the form.

My question is that is there in Oracle Forms any way to prevent the validation logic to be executed by e.g. setting the item status to valid?

Was it helpful?

Solution

When the value is changed programmatically,

set_item_property('block_name.item', item_is_valid, property_true);

OTHER TIPS

There are a few possible ways to do this depending on how your item is changed and which properties are on the item.

1) if your item is a database item and you fill during a normal query the when-validate-item trigger will not fire.

2) if you don't fill it with a normal query you can change the time of validation from item to record or even to form. That way it will only be validated the moment you perform a commit or you leave the form.

3) is of course keep track of these changes and don't let the validation go off.

PS: normally you don't do things in you're when-validate-item trigger that will be a problem when it is filled from behind the scenes, so I don't know what your code inside the trigger is but it should only be a validation of the input value and if this is wrong it should say so even when it is filled with code instead of the user.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top