Hi, I'm running the code below on the save of a quick create form (and passing in context). When there are no errors it runs and saves fine. When an error is encountered it prevents the save as it should and displays error messages in the validateXX functions. The problem is once I clear up the errors the save button will not function. The mouseover works, but it does not respond to the click. What I did notice is the little blue dots at the top of the quick create continue to cycle like the page is loading. Thoughts or hints?
function form_OnSave()
{
var errorCount = 0;
var activityType = Xrm.Page.getAttribute("ocsd_k9activitytype").getValue();
if (activityType == null)
{
alert("Something went wrong, there is not activity type for this record, please contact Systems");
arguments[0].getEventArgs().preventDefault();
}
if (activityType == 868030004) //training scenario validation
{
errorCount = validateScenario() + validateMeasurement() + validateTraining() + validatePassFail() + validateAmountQty();
}
else
{
errorCount = validateAmountQty() + validateField() + validateMeasurement();
}
if (errorCount != 0) {
arguments[0].getEventArgs().preventDefault();
}
}
*This post is locked for comments
I have the same question (0)