Invalid Populated Field In Child

Forums vLooup for SharePoint Invalid Populated Field In Child

Viewing 1 reply thread
  • Author
    Posts
    • #35863
      SteveE
      Participant

      Hi Alexander,

      Many times when populating fields in the child form, I make them read-only so they match the parent. The issue I’ve run into is that if it populates a field such as people picker and that user no longer exists, it won’t allow the user to save the child. There’s no indication as to why – it just bumps up to the top of the form. When I troubleshoot, I release the read-only rule to find that the people picker will rightfully not accept the now invalid user.

      I’m wondering if there is a way to show the user the indicator that the populated (and read-only) field cannot be validated. Or any other suggestions you may have. Thanks for your time!

    • #35864
      Alexander Bautz
      Keymaster

      Hi,
      You can add this to your custom js to make a field editable when a validation error exists:

      setInterval(function(){
          jQuery(".ms-formvalidation").each(function(i, elm){
              var tr = jQuery(elm).parents("tr:first");
              var fin = tr.attr("id").split("dffs_")[1];
              var isReadonly = tr.hasClass("dffs-readonly");
              if(fin !== undefined && isReadonly){
                  spjs.dffs.undoReadOnly([fin]);
              }
          });
      },3000);
      

      Let me know how this works out.

      Alexander

      • #35865
        SteveE
        Participant

        That works! Awesome as always!

Viewing 1 reply thread
  • You must be logged in to reply to this topic.