How to find which Option Group is associated to certain Form

Document ID : KB000100520
Last Modified Date : 12/06/2018
Show Technical Document Details
Introduction:
During implementation process, a huge amount of Forms can be created to perform tests, but then those Form could be left there. If for some reason a Form must be deleted, the 'Delete' button will be unavailable if it's associated to an Option Group, but since large environments can have a lot of Option Groups, sometimes is hard to find what Option Group is actually using the Form.
Question:
How to find which Option Group is associated to certain Form?
Answer:
1.- Go to Form Designer and get the name of the FORM you are trying to delete and you are unable to:

User-added image

2.- Run the following query:

SELECT * FROM usm_form_entities WHERE form_entity_name LIKE '%name_of_form%'

User-added image

3.- The result will show a line with different values, we are looking for the value under "form_entity_id".

NOTE: If you are not sure if this is the FORM, you can check the ID under "form_entity_parent_id" and this should point to the Folder that holds this FORM.

4.- Now with the above result ("form_entity_id"), you can run the following query:

SELECT * FROM usm_rate_definition WHERE text_1 = 'xxx'

User-added image
NOTE: The "xxx" is the "form_entity_id", but you need to enclose it because the field "text_1" is a string.

5.- If the above query brings any result, it means your FORM is associated to an Option, now in order to identify which option is, you can take the value of the field "rate_plan_id" and use it in the following query:

SELECT * FROM usm_rate_plan WHERE rate_plan_id = YYY

User-added image
6.- This will give you the Option Group associated to that Form, which is the cause of why you are unable to delete it.

User-added image