Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Require Non-Hidden Fields by Section

olearm2
Contributor II

Hi all,

 

We are building a dynamic questionnaire with almost 400 questions.  About 2/3 of these questions are hidden, but will display dynamically based on answers of other questions.  The general requirement is basically: If the question is displaying on layout, it should become Required when the record is Submitted. 

 

Goal

To accomplish this, I'm trying to build a custom object that will do the heavy lifting.  This custom object would, in each Question Section:

  •    Identify all underlying questions that are not hidden
  •    Evaluate whether or not the question is empty
  •    If the question is empty, highlight the Question Name in Red

 

Purpose

  • Maintainability: Given the volume of questions, there is already a massive number of DDEs to govern the show/hide logic.  Instead of triplicating the number of DDE rules to handle making the fields required/Read Only, I want the Custom Object to dynamically manage this.  
  • User Experience:  Field-level red asterisks currently do not work with the AWF transition rules. By leveraging the Custom Object, I can ease the burden of finding the handful of questions out of 400 that are missing values by changing the question font to be more noticeable, or providing a summary table of empty questions by section, etc.

 

Approach

High-level plan for now is:

  1. Unbind the action from the AWF transition to do the checks below:
  2. Use each section ID (i.e. "#master_DefaultContent_rts_..." to find its children elements with an attribute of visibleitems="1" or by ignoring descendants with a span class of "hidden".  Strip out the Field ID (e.g. 43506) from either the <tr class> value or the <span ID> value and store in an array (i.e. "displayFields[]").
  3. Use displayFields[] items to iterate/check using getFieldValue() and any blank/empty Field IDs will get stored in another array (i.e. "blankFields[]").
  4. For each blankFields[] item, set the style property to call out fields needing attention, similar to the approach taken here: Color Section Header Text 
  5. If none of the displayed questions are blank, proceed with the AWF transition.

 

Questions

  • Has anyone created a similar custom object or can tell me how impossible/foolish this is to undertake?
  • Is there anything that I could do to simplify this approach?  Perhaps any $CM or $LM functions that I am not considering?

 

I have done custom object work before, but nothing of this magnitude, so would appreciate any feedback/suggestions.  Thanks!

0 REPLIES 0