When adding a new field in an application/questionnaire and selecting the type as
Sub-Form, the browser becomes blank as shown below.
0EMVM000001hLBt.png This occurs due to a bad data condition where one or more
Sub-Forms exist without a
Level Id.
To confirm this, perform one or both of the following approaches:
1. Execute the below script that will retrieve all the Sub-Forms that exist without a Level Id:
SELECT DB_NAME() db_name,
CASE m.module_type_id WHEN 2 THEN 'App' WHEN 5 THEN 'SubForm' WHEN 7 THEN 'QUES' END module_type,
m.module_id,
mt.module_name,
(SELECT c.company_name FROM dbo.tblCompany c) company_name,
1 row_number
FROM dbo.tblModule m
JOIN tblModuleTranslation mt ON mt.module_id = m.module_id AND mt.is_default = 1
LEFT JOIN dbo.tblLevel l ON l.module_id = m.module_id
WHERE l.level_id IS NULL
AND m.module_type_id IN ( 2, 5, 7 )
AND m.deleted = 0;
2. Run a
Network Trace from the browser's
Developer Tools while the issue is occurring. The Network Trace should capture the following:
0EMVM000001hLOn.pngTo determine which Sub-Form is missing its level Id, click on the below call (highlighted in the screenshot above) and navigate to the
Response tab:
ManageModules?$filter=(Type%20eq%20%27SubForm%27)&$count=true&$orderby=Name%20asc
In the Response tab, all Sub-Forms should be shown and each Sub-Form has two Ids. Scroll down in this tab until you locate one or more Sub-Forms that have only one Id (as shown below).
0EMVM000001hMMT.pngIn the example above,
_Test_Subform has two Ids which are 711 and 519. On the other hand,
AAH_Risk_Assessment_Notes__Comments__Fee has only one Id which is 802 and is missing the other Id which makes this the corrupted Sub-Form as it is missing its level Id.
Note: In some cases, a 404 error might also be captured in the Network Trace.
After identifying the corrupted Sub-Form(s) missing their level Id using the approaches stated above, delete these Sub-Forms from the UI and recreate them if needed.
Note: Make sure record content is not associated prior to deleting the Sub-Form.
Following this, you should be able to create and add new Sub-Form fields successfully.