- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2019 04:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2019 05:40 AM
getXMLAnswer() saves you a line of code every time you use it. That is it. There shouldn't be any noticeable difference in speed, though this method is probably guaranteed to be slightly slower as it runs at least one more line of code each time. So ease of use vs minuscule difference in speed.
with getXMLAnswer() uou no longer need this line of code.
var comments = response.responseXML.documentElement.getAttribute("answer");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2020 03:58 AM
One interesting fact about getXMLAnswer() method is that they are asynchronous in nature and they might not work with onSubmit client script because till they return answer onsubmit process might have been completed already.
So to avoid this situation you would use synchronous method i.e. getXMLWait() but this method also has some implications as its not accessible in Scoped app and in servicePortal.
So the best approach would be to create onChange scripts to validate user input when values are entered, rather when submitting the form. You could also enforce input validation with a Before Insert business rule and notify user for invalid input via messages.