In spBeforeSave, I have the following, but i am getting an items is not defined error
var count = fd.control('SPDataTable1).widget.dataItems();
if(count){
for (var i=0; i<count.length; i++){
var dFN = count[i].Field1;
pnp.sp.web.list.getByTitle('ChildList').items.filter("Field1 eq " + dFN + "' and Date eq '09/01/2023').getAll().then(function(item){
if(item.length> 10) {
altert("More than 10 items.");
}
})
return items.length;
);
);
/*** end of spBeforeSave **///
I have added alerts to find out that the error is coming from the pnp statement.
Any help is appreciated.
Thanks