Require child list to have at least one record

Hello,

How do I require a child list or library to have at least one record before the parent form can be saved? I tried using the code below but it doesn't work:

fd.spRendered(function() {

fd.control('SPDataTable1').addValidator({
error: 'Error message',
validate: function(value) {
if (value.length == 0) {
this.error = "Add at least one record to the table";
return false;
}

    return true;
}

});

});

Hello @ParAvion,

Please use the code from this post to add validation to List or Library control: