Referential integrity on a Reference selection in a Form
M
Matthew AMMONS
started a topic
over 1 year ago
I have a field that has a reference selection on it(Special Brand). The reference selection is filtered based on a user entry on another field on the form(Brand). For example:
If the user makes a selection for Special brand the value is held in the field:
The issue I'm facing is, if the user changes the first field(used to filter the reference selection) Brand in this case, the second field in invalid it breaks the referential integrity. See below:
But if I hit the dropdown...
Is there a way to check the Referential integrity of the Reference selection when the filter field(Brand) is changed?
Best Answer
A
Alexia SIMOND
said
over 1 year ago
Hello Matthew,
I can think of 2 things depending on what you want to achieve:
Either create an enricher that will nullify the "Special Brand" if its "Brand" is no longer the right one.
Or create a validation that will at least warn (and/or block) the user from pursuing the authoring if the brand's special brand is no longer the right one.
Here are more elements on how to do so.
I took a simple example of a main entity and 2 references (country and city).
Enricher option:
Create an enricher to nullify the reference (in your case "Special Brand"):
> Expression: "case when FID_Country <> City.FID_Country then null else FID_City end"
Call this enricher in your stepper in the form enricher section "on data change":
Validation option:
Create a validation to warn when the 2 references are not consistent:
Call the validation in the stepper whenever needed. It can be in form validations "on data change":
Or if you want to block the authoring altogether, you can activate it at "step transition validations" on "block":
Or directly in the validations on "block":
Hope that helps.
1 Comment
A
Alexia SIMOND
said
over 1 year ago
Answer
Hello Matthew,
I can think of 2 things depending on what you want to achieve:
Either create an enricher that will nullify the "Special Brand" if its "Brand" is no longer the right one.
Or create a validation that will at least warn (and/or block) the user from pursuing the authoring if the brand's special brand is no longer the right one.
Here are more elements on how to do so.
I took a simple example of a main entity and 2 references (country and city).
Enricher option:
Create an enricher to nullify the reference (in your case "Special Brand"):
> Expression: "case when FID_Country <> City.FID_Country then null else FID_City end"
Call this enricher in your stepper in the form enricher section "on data change":
Validation option:
Create a validation to warn when the 2 references are not consistent:
Call the validation in the stepper whenever needed. It can be in form validations "on data change":
Or if you want to block the authoring altogether, you can activate it at "step transition validations" on "block":
Matthew AMMONS
I have a field that has a reference selection on it(Special Brand). The reference selection is filtered based on a user entry on another field on the form(Brand). For example:
If the user makes a selection for Special brand the value is held in the field:
The issue I'm facing is, if the user changes the first field(used to filter the reference selection) Brand in this case, the second field in invalid it breaks the referential integrity. See below:
But if I hit the dropdown...
Is there a way to check the Referential integrity of the Reference selection when the filter field(Brand) is changed?
Hello Matthew,
I can think of 2 things depending on what you want to achieve:
Here are more elements on how to do so.
I took a simple example of a main entity and 2 references (country and city).
Enricher option:
> Expression: "case when FID_Country <> City.FID_Country then null else FID_City end"
Validation option:
Or directly in the validations on "block":
Hope that helps.
Alexia SIMOND
Hello Matthew,
I can think of 2 things depending on what you want to achieve:
Here are more elements on how to do so.
I took a simple example of a main entity and 2 references (country and city).
Enricher option:
> Expression: "case when FID_Country <> City.FID_Country then null else FID_City end"
Validation option:
Or directly in the validations on "block":
Hope that helps.
-
Extend a model with new entities or attributes
-
Data types in xDM
-
Effective date on entities
-
Search using wild cards
-
Export a model from production and import on a development environment
-
"Allow Delete" vs "Allow Removal" privileges
-
LOV label in Named Query
-
Select location on a map and save coordinates
-
Is there a way to set up a master-detail relationship on browse mode?
-
Choose Either a Stepper or A Workflow Based on The User Privileges
See all 346 topics