Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

UI Action and emailClientOpenPop

ashish9
Tera Contributor

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

1 ACCEPTED SOLUTION

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

33 REPLIES 33

ashish9
Tera Contributor

@Ankur can you once check if you have any idea about the https://community.servicenow.com/community?id=community_question&sys_id=64e67a631b687410d01143f6fe4bcb34&anchor=answer_36fff66cdb74f01092bb0b55ca96193e

Thank You

Hi Ankur, Can you check this https://community.servicenow.com/community?id=community_question&sys_id=9781f6f91bcd3450aefc11751a4bcb8a

Thank You

Hi Ankur, 

 

Can you please check if you have done something like this,

 https://community.servicenow.com/community?id=community_question&sys_id=960e9b32db257c90aa66a9fb13961951

Thanks

Ashish

Hi Ankur,

 

Hope you are doing good can you look into the ServiceNow Data export to a SQL table - IT Service Management - Question - ServiceNow Community I want to insert data in a external data base.

 

Thanks

Ashish