Some items are stored in the list without required fields

Good day,
I have a list, users create about 100 items per day. This form have 3-5 required fields. But some items are created without this fields, and there are as error in list. Why it happens?


Dear @ixxxl,
We'll need a little more information about the case. If it's indeed a bug - we'll need a way to reproduce it. Are you absolutely sure that the forms are submitted empty, and that the fields are not emptied later? Are there any workflows that could be removing the information from fields? What kinds of fields are missing most often?

Any specific actions that lead to this situation? Any errors in browser's console? Can you perhaps record this happening on video, or provide us access to the site, so we can try to reproduce it?

@Nikita_Kurguzov
Hi,
yes the form is absolutely empty. some workflows i didn't have that can remove this fields. The form is saving without this validation, this is person field (autopopulate on load)some single text, they are populated from user profile, such as department, jot title, and some manual - pc number and phone number. It can be 1-5 per day, but can be ok for several days. i don't know how to see it at user browser, because it's chaotic, and i can't to reproduce it.. most of 100 items per day ,works perfectly...
This is code of new form.

         fd.spRendered(function() {
            function disableFields() {
                //Add current user to form field
           fd.field('Utilizator').value = _spPageContextInfo.userDisplayName;
           //Hide system fields
          $('.sysfields').hide();
        $('.dropbox').hide();
       $('.textbox').hide();
       $('.peoplepicker').hide();
       $('.instructiuni').hide();
       $('.datatable').hide();
          //Placeholder PC Field
          fd.field('Num_x0103_rul_x0020_PC').placeholder = 'EX. PC01...';
          fd.field('Num_x0103_rul_x0020_de_x0020_con').placeholder = 'EX. 022 303 ...';
          //Disable Field Instructiuni
          fd.field('Instruc_x021b_iuni').disabled = true;
          //Disable status field
          fd.field('Statutul_x0020_Cererii').disabled = true;
          //Hide deafault sharepoint form buttons
       $(fd.field('Category').$parent.$el).hide();
          fd.toolbar.buttons[0].style = "display: none;";
          //Disable Title field
       fd.field('OpenForm').value=Date.now();
           //Disable auto populated fields
             fd.field('Utilizator').disabled = true;
             fd.field('Functia').disabled = true;
          fd.field('Departament').disabled = true;
          fd.field('Numarul_x0020_de_x0020_tabel').disabled = true;
          fd.field('Num_x0103_rul_x0020_PC').value = null;
       fd.field('Num_x0103_rul_x0020_PC').value = null;
       fd.field('Num_x0103_rul_x0020_de_x0020_con').value = null;
       fd.field('Linia_x0020_Support').value = null;
	          fd.field('Linia').value = null;
       fd.field('Category').value = null;
       fd.field('Problem').value = null;
       fd.field('Product').value = null;
       fd.field('PeoplePicker').value = null;
       //fd.field('datatable').value = null;
       fd.field('TextBox').value = null;
       fd.field('Comentriile_x0020_utilizatorului').value = null;
       fd.field('TipControl').value = null;
       fd.field('TextControl').value=null;
       fd.field('Instruc_x021b_iuni').value = null;
       $('.dropbox').hide();
           }
           disableFields();
         });
       
       fd.spRendered(function() {
         function updateUserInfo() {
                 pnp.sp.profiles.myProperties.get().then(function(result) {
                 var props = result.UserProfileProperties;
                 var subdiv="";
                 var niv1="";
                 var niv2="";
                 var niv3="";
                 for (var i = 0; i < props.length; i++) {
                     switch (props[i].Key) {
                       // Sharepoint or AD attribute  
                       case 'Office':
                           //Form Field Internal name
                             fd.field('Numarul_x0020_de_x0020_tabel').value = props[i].Value;
                             break;
                       // Sharepoint or AD attribute 
                      case 'DENNIVEL1':
                           //Form Field Internal name
                             niv1 = props[i].Value;
                             break;
                             case 'DENNIVEL2':
                           //Form Field Internal name
                             niv2 = props[i].Value;
                             break;
                             case 'DENNIVEL3':
                           //Form Field Internal name
                             niv3 = props[i].Value;
                             break;	
                             case 'Title':
                           //Form Field Internal name
                             fd.field('Functia').value = props[i].Value;
                             break;
           case 'bossLevel1':
                               //Form Field Internal name
                               fd.field('Boss1').value = props[i].Value;
                               break;
                       }
                 }
                 subdiv=niv1;
                 if (niv2 !="") {subdiv+="/"+niv2}
                 if (niv3 !="") {subdiv+="/"+niv3}
                 fd.field('Departament').value=subdiv;
             });
           }
           //executes updateUserInfo on form load
           updateUserInfo();
       });
         
            //Get additional fields value from tip support 
       
           function setMasterField() {
              if (fd.field('Category').value) {
                      //trag instructiunea si daca gol o ascund
                   fd.field('Instruc_x021b_iuni').value = fd.field('Category').value.Instruction;
                       if (fd.field('Instruc_x021b_iuni').value){
                             $('.instructiuni').show();
                                 fd.field('Comentriile_x0020_utilizatorului').required = true;
                        } else {
                             // Disable Button
                             $('.instructiuni').hide();
                             fd.field('Comentriile_x0020_utilizatorului').required = false;
                         }//if instructiune      
                   
                   //trag nume camp master si denumesc controlul aferent
                   fd.field('TextControl').value = fd.field('Category').value.Control_x0020_Name;
                   fd.field('Product').title = fd.field('TextControl').value;
                   fd.field('TextBox').title = fd.field('TextControl').value;
                   fd.field('PeoplePicker').title = fd.field('TextControl').value;
                   fd.control('Text4').text = fd.field('TextControl').value;
                   /*
                   if (fd.field('TipControl').value == "datatable") {
                                      $('.datatable').show();
                                   $('.textbox').hide();
                                   //fd.field('datatable').required = true;
                            }*/
                   
                   //trag tipul de control pentru camp master si ascund/required restul
                   fd.field('TipControl').value = fd.field('Category').value.Control_x0020_Type;
                       if (fd.field('TipControl').value == "dropbox") {
                           $('.dropbox').show();
                           fd.field('Product').required = true;
                       } else {
                           $('.dropbox').hide();
                           fd.field('Product').required = false;
                       } 
                       if (fd.field('TipControl').value == "datatable") {
                        $('.datatable').show()
						
                        fd.field('Product').required = false;;
                     $('.textbox').hide();
                    }
                     else {

                     }
                     //fd.field('datatable').required = true;
                              
                               
                       if (fd.field('TipControl').value == "textbox") {
					    $('.datatable').hide()
                                   $('.textbox').show();
								   
                                   fd.field('TextBox').required = true;
                            } else {
                                   $('.textbox').hide();
                                   fd.field('TextBox').required = false;
                               }
                        if (fd.field('TipControl').value == "peoplepicker") {
                       $('.peoplepicker').show();
					    $('.datatable').hide()
                       fd.field('PeoplePicker').required = true;
                        } else {
                       $('.peoplepicker').hide();
                       fd.field('PeoplePicker').required = false;
                   }
               } else {
                   $('.dropbox').hide();
                   fd.field('Product').required = false
                   $('.textbox').hide();
                   fd.field('TextBox').required = false;
                    $('.peoplepicker').hide();
                   fd.field('PeoplePicker').required = false;
                   $('.datatable').hide();
               }//if category
         }
           
         fd.spRendered(function() {
                fd.field('Linia_x0020_Support').$on('change',setMasterField);
				fd.field('Linia').$on('change',setMasterField);
               fd.field('Category').$on('change',setMasterField);
               fd.field('Product').$on('change',setMasterField);
       setMasterField();
        });  
         //////////////////////////////FILTREAZA PROBLEMELE SI PRODUSELE//////////////////////////////////////////    
           function filterCategory(linie) {
             var linieID = linie && linie.LookupId || linie || null;
			// alert(linieID)
            fd.field('Category').filter = "Stare eq 'Activ' and Linia eq '" + linieID +"'";
             fd.field('Category').widget.dataSource.read();
         }
         fd.spRendered(function() {
             fd.field('Category').ready().then(function() {
                 //filter Problems when Category changes
                 fd.field('Linia').$on('change', function(value){
                     filterCategory(value);
                     fd.field('Category').value = null;
                       //setMasterField();
                  });
             //filter Categories when form opens
              /*   fd.field('Linia_x0020_Support').ready().then(function(field) {
                     filterCategory(field.value);
                 });*/
             });
         });
         
          function filterProblem(category) {
             var categoryId = category && category.LookupId || category || null;
            fd.field('Problem').filter = "TypeProblema/Id eq " + categoryId +" and Stare eq 'Activ'";
             fd.field('Problem').widget.dataSource.read();
         }
         fd.spRendered(function() {
             fd.field('Problem').ready().then(function() {
                 //filter Problems when Category changes
                 fd.field('Category').$on('change', function(value){
                     filterProblem(value);
                     fd.field('Problem').value = null;
                  });
             //filter Problems when form opens
                 fd.field('Category').ready().then(function(field) {
                     filterProblem(field.value);
                 });
             });
         });
       
          function filterProduct(category) {
             var categoryId = category && category.LookupId || category || null;
             fd.field('Product').filter = "Category/Id eq " + categoryId +" and Stare eq 'Activ'";
             fd.field('Product').widget.dataSource.read();
         }
         fd.spRendered(function() {
           fd.field('Product').ready().then(function() {
               //filter Products when Category changes
               fd.field('Category').$on('change', function(value){
                   filterProduct(value);
                   fd.field('Product').value = null;
               });
               //filter Products when form opens
               fd.field('Category').ready().then(function(field) {
                   filterProduct(field.value);
               });
           });
       });
         /////////////////////////////////////////////////////////////////////////////
         
         
         //Hide Tip problema until Tip support is empty 
         fd.spRendered(function() {
         
           function hideOrShowProblem() {
               if (fd.field('Category').value) {
                   // Show the Due Date field
                   $(fd.field('Problem').$parent.$el).show();
				    fd.field('contor').value=fd.field('Category').value.Litera_x0020_de_x0020_contor
               } else {
                   // Hide the Due Date field
                   $(fd.field('Problem').$parent.$el).hide();
				       fd.field('contor').value=null
               }
           }
         
           // Calling hideOrShowDueDate when the user changes the Start Date
               fd.field('Linia').$on('change',hideOrShowProblem);
           fd.field('Category').$on('change',hideOrShowProblem);
         
           // Calling hideOrShowDueDate on form loading
           hideOrShowProblem();
         
         });
         
         //daca instructiuni ii gol hide
       
              fd.spRendered(function() {
         
           function hideOrShowCategory() {
               if (fd.field('Linia').value) {
                   // Show the Due Date field
                   $(fd.field('Category').$parent.$el).show();
               } else {
                   // Hide the Due Date field
                   $(fd.field('Category').$parent.$el).hide();
               }
           }
         
           // Calling hideOrShowDueDate when the user changes the Start Date
           fd.field('Linia').$on('change',hideOrShowCategory);
         
           // Calling hideOrShowDueDate on form loading
           hideOrShowCategory();
         
         });
       fd.spRendered(function(){
         fd.field('Num_x0103_rul_x0020_de_x0020_con').validators.push({
           name: 'Phone number validator',
           error: 'Introduceți doar cifre',
           validate: function(value) {
               return value.match("^[0-9]*$");
           }
         });
       });
	   
	   fd.spRendered(function() {
    var textArea = fd.field('Comentriile_x0020_utilizatorului').$refs.textarea;
    function recalcHeight() {
        textArea.style.height = (textArea.scrollHeight > textArea.clientHeight) ? (textArea.scrollHeight) + "px" : "120px";
    }
    recalcHeight();
    $(textArea).keyup(recalcHeight);
    });
	
	

fd.spRendered(function() {
    var textArea = fd.field('Instruc_x021b_iuni').$refs.textarea;
    function recalcHeight1() {
        textArea.style.height = (textArea.scrollHeight > textArea.clientHeight) ? (textArea.scrollHeight) + "px" : "120px";
    }
    recalcHeight1();
    $(textArea).keyup(recalcHeight1);
    });

i see sometimes when or list is over loading, maybe server. in browser i have many fields that are hide on load, but persists in form. and in that time this fields are showed for 3-5 seconds, until the form loads.


When i test, it works correctly, if one field is empty it errors and didn't save the form..
This is log from browser console , of empty form

intranet-1622699909968.log (13.2 KB)

P.S.
it appears one more ... with empty fields

Dear @ixxxl,
Hmm, we'll still need more info in order to reproduce this issue. Can you reproduce it yourself? Maybe you can ask users of what they did, that lead to this situation?

Is this the only list with such issue or are there any other ones?

@Nikita_Kurguzov
i can't reproduce it myself.. at my testing it's ok :slightly_smiling_face:
i will try to see what happens at user part.
it's only this one list with such issue

Dear @ixxxl,
Anything else that might be different for these users? Maybe they're using IE/Safari browser or some mobile device? Something that would be different from your setup?

@Nikita_Kurguzov
All they use or google chrome or microsoft edge. no more ideas..
for the past 3 days no error items.

Dear @ixxxl,
Okay, keep monitoring, and if you get any information - please, keep us updated. Maybe if this happens to a user in the future, you might find out what their experience with the form was - did the fields load, did they fill them out or not, and if not was there any error, etc. The more information you can get on how it can be reproduced - the better!

@Nikita_Kurguzov
Hi, today i have 2 wrong items. I contacted user and the problem was when he attached file. i asked the file name - Contractul de credit_LiberCard(1).docx
Tried to reproduce on my pc and a give an error on saving, but it saves at end with fields ok, but without attached files. another files with other file name are storied ok. how to validate file name before saving. it seems that it unlike "()" symbols


image

PS. my file was 0.00 kb, that's was the issue, i write some symbols and was able to save it with - Contractul de credit_LiberCard(1).docx
but user have many pages of contract in this file.

i tried another file - Contractul de credit_LiberCard(1)%^&&$%#$((!#$%^(.docx - and give error
I know that sharepoint have some character restrictions, but the form is saving, and workflow sends email. I need validation without submiting, that if the form have some errors, user must them to resolve, only than to submit it. is there such validation ?

Dear @ixxxl,
Thank you for the report! Yes, this is a known issue, which was fixed in SharePoint Online some time ago, and we're currently in the process of migrating fixes to On-Premises. It might take a little time, but a fix will be released soon.

But this is not connected to empty required fields as far as I know, right?

@Nikita_Kurguzov
thank you, we will wait update.

But this is not connected to empty required fields as far as I know, right?
I think yes it's not about required fields. But it strange that it saves with empty at some uers. i will try to speak with others users, when i will see empty fields.