Hello,
I have a list or library control on my main form that contains a dropdown called 'Items' that has lookup values. When a user selects 'Face shields' from the Items dropdown, i would like to restrict the value in the 'Quantity' field to 1.
My code isn't working:
fd.spRendered(function() {
fd.control('SPDataTable1').$on('edit', function(editData) {
editData.field('Quantity').validators.push({
name: 'MyCustomValidator2',
error: '',
validate: function(value) {
if (editData.field('Item').value == 'Face shields') {
if (value >= 1) {
this.error = 'Please select a quantity of 1';
return false;
}
}
return true;
}
});
});
});