I’ve referenced these 2 posts (here and here), and both say returning false should stop the successive actions from running…but I’m having no luck.
var params = argumentsu0];
var step = params.step; var $ = skuid.$; // Get Incentive and Template Requirements models var models = skuid.model.map(); var requirements = models.TemplateRequirement; var incentive = models.Incentive; // Get fields from each model for use in validation var incentiveRow = incentive.getFirstRow(); var incentiveStart = incentive.getFieldValue(incentiveRow, "Incentive_Start_Date__c"); var incentiveEnd = incentive.getFieldValue(incentiveRow, "Incentive_End_Date__c"); // for each Template Requirement, validate the Milestone Date is within range of the Incentive Start and End Dates. $.each(requirements.getRows() ,function(){ var requirementRow = this; var milestone = requirements.getFieldValue(requirementRow, "Milestone_Date__c"); if (milestone < incentiveStart) { alert("Milestone Date(s) can not be prior to the Incentive Start Date"); return false; } else if (milestone > incentiveEnd) { alert("Milestone Date(s) can not be later than the Incentive End Date"); return false; } });
If I’m doing something blatantly obvious and wrong, please be kind This is the first block of code I’ve ever written from scratch.