Menu

The field [%fieldB%] should be after [%fieldA%]. The relationship [%rel%] expects the sequence [...]

0 votes

When saving the table preferences I get the following error

The field [%fieldA%] should be after [%fieldB%].
The relationship [%rel%] expects the sequence [%fieldA%,%fieldB%]

What is going on and how do I fix this error?

in Errors by (7.2k points)

1 Answer

0 votes

This error will only appear if you are placing fields that are part of a cascading-lookup.

For an in-depth look at creating cascading lookups see: Cascading Lookups

The issue is that the cascading lookup needs the user to fill in one field first so that it can then filter down for the options that should be available to the second field.

The field that should be first is the field which can be resolved to a simpler lookup. If there are only two fields in the cascading-lookup, then the expectation is that the first field you place should reference a table where it it can resolve to a simple lookup.

For example if you have multiple models of a product, then in the cascading dropdown the user would normally choose the Product first before selecting the Model. This would also show up in the relationship that defines that cascading-lookup.

ALTER TABLE InvoiceTable
    ADD CONSTRAINT FK_InvoiceTable_to_ProductModel
    FOREIGN KEY(ProductID, ProductModelID)
    REFERENCES ProductModel (ProductID, ProductModelID);  

Notice the ordering of the foreign keys and the referenced fields.

The simple fix would be to place the ProductID field in the form above the ProductModelID field.

by (64.9k points)
Welcome to the dbFront Q&A site, where you can ask questions and receive answers from other members of the community.
 | Minimalist Answer Theme by Digitizor Media
 |
Powered by Question2Answer
...