- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2021 10:06 AM
I have a button Approval on XYZ form.
If I click on Approval button while Client is selected and onClick event as emailClientOpenPop('sc_task'); it open the Email Pop up perfectly.
But if I unchecked Client it hide the onClick option and I can change the current.u_status = 'Close'; on the XYZ form.
But actual requirement is both think Email Client Pop up and the status update should happen simultaneously.
So is it possible I can call Email Client pop up from script and at the same time it updates the status.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2021 09:26 PM
Hi,
Script looks good.
Did you try adding logs in script include
var UpdateRecord = Class.create();
UpdateRecord.prototype = Object.extendsObject(AbstractAjaxProcessor, {
updateMyRecord: function(){
var sysId = this.getParameter('sysparm_id');
gs.info('sysId' +sysId);
var tableName = this.getParameter('sysparm_table');
var gr = new GlideRecord('XYZ');
gr.addQuery("sys_id", sysId);
gr.query();
if (gr.next()) {
gs.info('Record found');
gr.u_status = 'Approved';
gr.update();
}
},
type: 'UpdateRecord'
});
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2021 08:34 AM
You have declared function validateForm() { twice please remove the first line and try it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2021 09:09 AM
Sorry that was just copied 2 times.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2021 09:26 AM
Can you please show us your UI action? Confirm_Status is action name field data only right in the UI action?
Also please check Approved choice value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2021 10:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2021 10:33 AM
I can see you haven't checked the form button checkbox in UI action, the above script perfectly worked for me if Form button checkbox is checked. I don't think it'll work for List Bottom button check box.
