Rules Limitation?

Home Forums Classic DFFS Rules Limitation?

Viewing 3 reply threads
  • Author
    Posts
    • #6419
      Kyle Vaske
      Participant

        Is there an amount limitation to the rules that can be applied a form? I have created a list that is growing rather large as the users keep asking for more data to be displayed on it. The list format is several questions that have a Yes/No choice, and then a comments field for each question. They are asking for a rule to be in place for if the answer is No, the comments tab will be required. This would be in place for over a hundred fields, with each question requiring a separate Rule. Will this get too large and slow down the processing of the list?

        • This topic was modified 10 years ago by Alexander Bautz. Reason: Moved to DFFS forum
      • #6420
        Alexander Bautz
        Keymaster

          There is not a definitive limit, but 100 rules will take its toll on the browser. I have not tried this myself though.

          Your specific requirement would be better solved with a few lines of custom JS. This will require a list of the fields you want to apply this rule to, and a corresponding list of comment fields to make required.

          I’ll try to whip up an example during the weekend.

          Alexander

        • #6422
          Kyle Vaske
          Participant

            A SharePoint List of all the Yes/No columns and another list of all the corresponding Comments columns? Do they need to have matching ID values for each corresponding set of fields?

          • #6463
            Alexander Bautz
            Keymaster

              Hi,
              Add this code to the Custom JS section in the Misc tab. Change the FieldInternalNames in the “arr” to match your field names:

              (function(){
              	var arr, chk; 
              	arr = [
              		{"trigger":"YesNoFieldNr1","comment":"YesNoFieldNr1_comment"},
              		{"trigger":"YesNoFieldNr2","comment":"YesNoFieldNr2_comment"},
              		{"trigger":"YesNoFieldNr3","comment":"YesNoFieldNr3_comment"}
              	];
              	$.each(arr,function(i,o){
              		// Click
              		chk = $(spjs.dffs.fields[o.trigger]).find("input:checkbox");
              		chk.click(function(){
              			toggle_requiredByYesNo($(this),o)
              		});
              		// Load
              		toggle_requiredByYesNo(chk,o);
              	});
              })();
              
              function toggle_requiredByYesNo(elm,o){
              	if(elm.prop("checked")){
              		spjs.dffs.flag_Mandatory([o.comment]);	
              	}else{
              		spjs.dffs.clear_Mandatory([o.comment]);	
              	}
              }

              Alexander

          Viewing 3 reply threads
          • You must be logged in to reply to this topic.