I am trying to create a TRUE FALSE Enum based read only custom field in “Multilevel Availability Check” Screen at line level.
The enum I created is a simple custom enumeration of 2 choices True and False.
Since the field is read only I have written the Select Statement with a CASE that If a certain 2 column values match return TRUE or FALSE from that case but when I try to finish the field creation I get the error as attached.
Can somebody tell me how to fix it ?
Page 1 / 1
Hi @amrflynn,
Could you please share the screenshota of the select statement you have written and the setup of the custom field.
Thanks,
Nilushi Silva
Hi @amrflynn,
Could you please share the screenshota of the select statement you have written and the setup of the custom field.
Thanks,
Nilushi Silva
So the SQL statement is like this -
SELECT CASE WHEN (A.AVAILABLE_QTY_ONHAND == A.TOTAL_SIM_DEMAND_QTY) THEN 'TRUE' ELSE 'FALSE' END FROM PART_AVAIL_STRUCTURE_FLAT_OV A WHERE A.TOP_CONTRACT = :TOP_CONTRACT AND A.TOP_PART_NO= :TOP_PART_NO AND A.TOP_ENG_CHG_LEVEL = :TOP_ENG_CHG_LEVEL AND A.TOP_BOM_TYPE = :TOP_BOM_TYPE AND A.TOP_ALTERNATIVE_NO = :TOP_ALTERNATIVE_NO AND A.STRUCTURE_SEQ_NO = :STRUCTURE_SEQ_NO AND A.PROJECT_ID = :PROJECT_ID AND A.ACTIVITY_SEQ = :ACTIVITY_SEQ
I have included all the key columns here and accordingly filled in the arguments.
As for the other setup, please see the attached image
For some reason after first attempt the Enumeration text looked like this image below but instead it should have been like Checked State Represents “TRUE and unchecked “False”.-
After this It was a standard setup of making field searchable and then to approve it and then click on finish but instead of finishing I got the error that was mentioned in the main post.
Thanks!
Hi @amrflynn,
Could you please share the screenshota of the select statement you have written and the setup of the custom field.
Thanks,
Nilushi Silva
this is the select statement -
SELECT CASE WHEN (A.AVAILABLE_QTY_ONHAND == A.TOTAL_SIM_DEMAND_QTY) THEN 'TRUE' ELSE 'FALSE' END FROM PART_AVAIL_STRUCTURE_FLAT_OV A WHERE A.TOP_CONTRACT = :TOP_CONTRACT AND A.TOP_PART_NO= :TOP_PART_NO AND A.TOP_ENG_CHG_LEVEL = :TOP_ENG_CHG_LEVEL AND A.TOP_BOM_TYPE = :TOP_BOM_TYPE AND A.TOP_ALTERNATIVE_NO = :TOP_ALTERNATIVE_NO AND A.STRUCTURE_SEQ_NO = :STRUCTURE_SEQ_NO AND A.PROJECT_ID = :PROJECT_ID AND A.ACTIVITY_SEQ = :ACTIVITY_SEQ
rest all the setting are standard setting that we do for enumeration type of static custom field
The Select Statement is - SELECT CASE WHEN (A.AVAILABLE_QTY_ONHAND == A.TOTAL_SIM_DEMAND_QTY) THEN 'TRUE' ELSE 'FALSE' END FROM PART_AVAIL_STRUCTURE_FLAT_OV A WHERE A.TOP_CONTRACT = :TOP_CONTRACT AND A.TOP_PART_NO= :TOP_PART_NO AND A.TOP_ENG_CHG_LEVEL = :TOP_ENG_CHG_LEVEL AND A.TOP_BOM_TYPE = :TOP_BOM_TYPE AND A.TOP_ALTERNATIVE_NO = :TOP_ALTERNATIVE_NO AND A.STRUCTURE_SEQ_NO = :STRUCTURE_SEQ_NO AND A.PROJECT_ID = :PROJECT_ID AND A.ACTIVITY_SEQ = :ACTIVITY_SEQ
Rest all settings are the standard settings that we do for a enumeration type of static custom field
Hi @amrflynn
I did something like below for the LU ShopMaterialAlloc and it worked.
Select Statement: select case when :SUPPLY_CODE='Invent Order' and :STATE='Released' then 'TRUE' else 'FALSE' end from shop_material_alloc
Select enumeration as FndBoolean.
This is the result after publishing the custom field.