On submit validations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
21 hours ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
16 hours ago
Try: if (response == 'true') {
in you client script, as '===' is more restrictive.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
14 hours ago
As with any script debugging, add alerts to your client script and gs.info lines to your script include to see how far it is getting, which if conditions are being met, and the value(s) passed from one to the other. Is your script include client callable and does it look like this at the beginning?
var GetUserDetails = Class.create();
GetUserDetails.prototype = Object.extendsObject(AbstractAjaxProcessor, {
In the client script, if the response is true, return true, don't submit as the submit action is already in progress when this script is running. You can also simplify your script include like this:
var GetUserDetails = Class.create();
GetUserDetails.prototype = Object.extendsObject(AbstractAjaxProcessor, {
isUserInGroup: function() {
var userId = this.getParameter('sysparm_user_id');
var groupId = this.getParameter('sysparm_group_id');
var thisUser = gs.getUser().getUserByID(userId);
return thisUser.isMemberOf(group);
},
type: 'GetUserDetails'
});