Hello,
I would like to check if someone is having the same behavior or I where did I go wrong on this code. I am trying to update a child list item on save. The update works if I hardcode the item id but not working if I use the following code below.
fd.spBeforeSave(function () {
var nextID = fd.itemId;
pnp.sp.web.lists.getByTitle("Test").items.filter("sourceID eq " + nextID.toString()).get().then(function (item) {
console.log(item);
pnp.sp.web.lists.getByTitle('Test').items.getById(item[0].Id).update({
Title: fd.field('PrepaidName').value,
APPrep2: 'testing',
sourceID: nextID.toString()
});
});
});