To troubleshoot a problem with a form, you have added a call to the MESSAGE () built-in at the
beginning of the When-Validate-Item trigger of the Customer_Id then in the Orders Block of the
Orders form. The message simply states that the trigger is firing.
You run the form, make a change in Customer_Id, and then tab out of the item but the message
does not appear. What are two possible causes for this problem?
A.
The form isinEnter-Query mode.
B.
The item is using an LOV for validation.
C.
The validation unit of the form needs to be changed.
D.
The MESSAGE () built-inis not allowedinvalidation triggers.
E.
There is a syntax errorinthe call to the MESSAGE() built-in.
F.
Validation for the Customer_Id item failed.
Explanation:
A: WHEN-VALIDATE-ITEM does not fire in ENTER-QUERY mode.
B: LOVs in ENTER-QUERY Mode
LOVs in ENTER-QUERY mode should be used sparingly, as Query Find is the preferred method
for a user to locate records.
You should only code them where they dramatically improve the usability of ENTER-QUERY
mode, and you expect this mode to be used regularly despite Query Find.
An LOV in ENTER-QUERY mode should display all values that the user can query, not just
currently valid values.
EXAMPLE: An LOV for vendors in a purchase order form in enter-query mode shows all vendors
that could ever be placed on a PO, not just the set of vendors that currently are allowed to be
placed on a PO.
Do not reuse the entry LOV in ENTER_QUERY mode unless it provides the correct set of data for
both modes.
Important: WHEN-VALIDATE-ITEM does not fire in ENTER-QUERY mode. Therefore, you cannot
depend on the WHEN-VALIDATE-ITEM trigger to clear hidden fields when selecting from an
ENTER-QUERY LOV.
Note: Validation occurs when you press enter, when you navigate away from the item, or when
you save your block to the database.
Note 2: When-Validate-Item trigger
Description
Fires during the Validate the Item process. Specifically, it fires as the last part of item validation
foritems with the New or Changed validation status.
Definition Levelform, block, or item
Legal Commands
SELECT statements, unrestricted built-ins
Enter Query Mode
no
Usage Notes
*Use a When-Validate-Item trigger to supplement Form Builder default item validation processing.
*It is possible to write a When-Validate-Item trigger that changes the value of an item that
FormBuilder is validating. If validation succeeds, Form Builder marks the changed item as Valid
anddoes not re-validate it. While this behavior is necessary to avoid validation loops, it does make
itpossible for your application to commit an invalid value to the database.
*The setting you choose for the Defer Required Enforcement property can affect the WhenValidate-Item trigger. See Defer_Required_Enforcement for details.
On Failure
If fired as part of validation initiated by navigation, navigation fails, and the focus remains on
theoriginal item.
Fires In
Validate the Item
B is not true. Even if LOV is used for validation WHEN-VALIDATE-ITEM fires. When validation unit is ‘greater’ then item then tabbig could result in non firing trigger. So C is correct.
Answer A,C
Answer – A, C