Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Custom function in PreSaveAction executes even before SharePoint validation

$
0
0

Hi All,

I have a custom function inside presaveaction which updates count in another list using rest api. I have custom edit form on which I have custom code and presave function. The issue is if title is null in editform and if user clicks on save button, the code goes in presave block and executes the custom function first and then gives me error "Title field cannot be blank" but ideally when user clicks save button, SharePoint validation should work and then execute presave function block

function PreSaveAction() {

UpdateCount()

}


I have custom edit form on which I have custom code and presave function. The issue is if title is null in editform and if user clicks on save button, the code goes in presave block and executes the custom function(updatecount) first and then gives me error"Title field cannot be blank" but ideally when user clicks save button, SharePoint validation should work and then execute presave function block.

So I want to make sure SharePoint validations are triggered first and if all validations are passed only then my custom validations in PreSave should be called. 


Thanks in Advance, Jiniv Thakkar


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>