Formulas (both formula fields and
conditional formatting formulas) that contain compile errors will have an error
icon. Also, an error message will be displayed in the Problems view.
From the
Window menu, select
Show
View and click
Problems.
Use the following example to learn the
necessary steps for debugging a formula. After completing this exercise, use
the same principles to debug your own formulas.
This tutorial uses the Xtreme sample
database.
This tutorial uses Crystal syntax.
The following formula is the formula
you will test for errors:
If ({CUSTOMER.CUSTOMER_NAME} [1 to 2 = "Bi" and
ToText({customer,CUSTOMER ID}) [1] = "6") Or
({CUSTOMER.CUSTOMER_NAME} [1 to 2] = 'Ro" and
ToText({CUSTOMER.CUSTOMER ID}) [1] = "5")
"PREFERRED CUSTOMER"
Else
"DOES NOT FIT CRITERIA"
If correct, this formula should pick out
all customers whose names begin with "Bi" and whose customer IDs begin with "6"
as well as those companies whose names begin with "Ro" and whose customer IDs
begin with "5". When printing the field, those selections will read "PREFERRED
CUSTOMER", while the rest will read "DOES NOT FIT CRITERIA".
You will now break down the formula to
check and see that each condition of the formula is working individually.