I have built an enricher based on a boolean value, it needs to enrich an LOV, logic can be seen below,
The first part works, where the Product.FridgeMaterialFlag is selected the 1 value is selected in the LOV, however the next part when the Product.FridgeMaterialFlag is not selected the LOV goes to null and not to 0, your guidance on how to resolve this would be much appreciated. I have two other scenarios like this, some guidance would be much appreciated.
Logic
Case
when Product.FridgeMaterialFlag = 1 then 1
when Product.FridgeMaterialFlag (boolean) = 0 then 0
end
Best Answer
B
Bharat Joshi
said
10 months ago
Hello
To achieve the above requirement of enriching the child Lov when the Boolean attribute is checked in the parent entity
You need to add this expression in your child enricher
Case
when test.testflag = '1' then 1
else 0
end
the above expression works fine when we are using postgres as the Database
but if we have sql server as the database
In the semql of enricher you need to type 1 and zero with inverted commas
then it will work fine
it is just because the sql server does not type cast it on its own
Keep the condition as given below for enricher 1 as well
And in the form enricher tab of stepper keep it as on data change for both the enricher not on form open
P
Paul Bolton
said
10 months ago
Hi,
Thanks for the guidance on this, I followed what your process of creating a second enricher and but I am getting the same result as soon as the flag is unticked the Class Keep Cool goes to null not 0
see screen prints below Enricher 1 (working) enricher 2 (not working)
To achieve this requirement we need to create two enricher to check both the conditions in two different enricher and also update it respectively
Create the first enricher to update the value of LOV as 1 with the filter as flag='1' as shown below
Create the second enricher with the second condition this will update the value of LOV as 0
now active both the enricher in stepper on data change
S
Stéphanie FOURRIER
said
10 months ago
Hi Paul,
after trying to reproduce your issue, I think I might have understood the root cause for your problem. If you want to enrich the LOV value "live", and have set the enricher to be run during the stepper "on data change", then the enricher is not triggered at all if the boolean value is not clicked by the user (thus not "changed"). When I also select "on form open", then the LOV value is set by default and updated if the user clicks on the boolean field.
Can you check it as well and give another try ?
Thanks for the update.
Stéphanie.
P
Paul Bolton
said
10 months ago
Hi Stephanie,
Unfortunately that does not work, the field that the enricher is meant to be populating populates for the positive (when Product.FridgeMaterialFlag = 1 then 1), however when the when FridgeMaterialFlag is unticked the value that I need it to populate is 0 (field that the enricher is run on) however it is recording Null (blank field)
S
Stéphanie FOURRIER
said
10 months ago
Hi Paul,
by default, the attribute values are equal to null when creating records. Did you try this?
Paul Bolton
Hi,
I have built an enricher based on a boolean value, it needs to enrich an LOV, logic can be seen below,
The first part works, where the Product.FridgeMaterialFlag is selected the 1 value is selected in the LOV, however the next part when the Product.FridgeMaterialFlag is not selected the LOV goes to null and not to 0, your guidance on how to resolve this would be much appreciated. I have two other scenarios like this, some guidance would be much appreciated.
Logic
Case
when Product.FridgeMaterialFlag = 1 then 1
when Product.FridgeMaterialFlag (boolean) = 0 then 0
end
Hello
To achieve the above requirement of enriching the child Lov when the Boolean attribute is checked in the parent entity
You need to add this expression in your child enricher
Case
when test.testflag = '1' then 1
else 0
end
the above expression works fine when we are using postgres as the Database
but if we have sql server as the database
- Oldest First
- Popular
- Newest First
Sorted by Newest FirstBharat Joshi
Hello
To achieve the above requirement of enriching the child Lov when the Boolean attribute is checked in the parent entity
You need to add this expression in your child enricher
Case
when test.testflag = '1' then 1
else 0
end
the above expression works fine when we are using postgres as the Database
but if we have sql server as the database
Paul Bolton
So I have followed your above guidance and nothing is working now
Bharat Joshi
Keep the condition as given below for enricher 1 as well
And in the form enricher tab of stepper keep it as on data change for both the enricher not on form open
Paul Bolton
Hi,
Thanks for the guidance on this, I followed what your process of creating a second enricher and but I am getting the same result as soon as the flag is unticked the Class Keep Cool goes to null not 0
see screen prints below Enricher 1 (working) enricher 2 (not working)
Bharat Joshi
Hello Paul,
To achieve this requirement we need to create two enricher to check both the conditions in two different enricher and also update it respectively
Create the first enricher to update the value of LOV as 1 with the filter as flag='1' as shown below
Create the second enricher with the second condition this will update the value of LOV as 0
now active both the enricher in stepper on data change
Stéphanie FOURRIER
Hi Paul,
after trying to reproduce your issue, I think I might have understood the root cause for your problem. If you want to enrich the LOV value "live", and have set the enricher to be run during the stepper "on data change", then the enricher is not triggered at all if the boolean value is not clicked by the user (thus not "changed"). When I also select "on form open", then the LOV value is set by default and updated if the user clicks on the boolean field.
Can you check it as well and give another try ?
Thanks for the update.
Stéphanie.
Paul Bolton
Hi Stephanie,
Unfortunately that does not work, the field that the enricher is meant to be populating populates for the positive (when Product.FridgeMaterialFlag = 1 then 1), however when the when FridgeMaterialFlag is unticked the value that I need it to populate is 0 (field that the enricher is run on) however it is recording Null (blank field)
Stéphanie FOURRIER
Hi Paul,
by default, the attribute values are equal to null when creating records. Did you try this?
I hope this helps.
Stéphanie.
Case
when Product.FridgeMaterialFlag = 1 then 1
else 0
end
-
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 275 topics