- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2017 02:03 AM
Hi,
Everything looks good in the script shared above except the Table Name in your Glide Record Query i.e. it should not be User(sys_user) table but it should be the Related List Table i.e. Verification Table in your scenario where you are trying to add the User Record on the Parent Change form. Update the Correct Table Name in the Query and try the below script again to check for the functionality.
Update your Code as per the below mentioned:
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var usr = new GlideRecord("Table Name"); //Replace here the Related List table i.e Table where you are adding the User Record on Change Form
usr.addEncodedQuery("parent=" + current.sys_id);
usr.query();
if(!usr.next())
{
gs.addInfoMessage("Please link a User Record at the bottom Verification Tab");
action.setRedirectURL(current);
current.setAbortAction(true);
}
})(current, previous);
Hope this helps.Mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke