- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2019 08:42 AM
I want to pass Trouble shooting number from server to client below is the code
Note : Scoped application
HTML
<div class="panel panel-default panel-body m-t m-b">
<button class="btn btn-primary btn- block" ng-click="c.execute()">Execte Error Code</button>
</div>
Client script
function() {
// /widget controller /
var c = this;
c.execute= function(){
c.server.update().then(function(response){
c.data ={};
alert(c.data.troubleshooting);
})
}}
Server Script
(function() {
var gr = new GlideRecord('x_qune_ca_troubleshooting');
gr.initialize();
gr.insert();
var strTroubleShootingNumber = gr.number;
gs.eventQueue('x_qune_ca.execute_analysis', gr, strTroubleShootingNumber, '');
gr.status = 'analyzing_cmdb_logs';
gr.update();
troubleshooting={};
troubleshooting.strSysID = gr.sys_id;
troubleshooting.strTroubleShootingNumber = gr.number;
})();
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2019 09:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2019 09:09 AM
tried this..but I'm getting "undefined"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2019 09:51 AM
I modified Client script like below
function() {
// /widget controller /
var c = this;
c.execute= function(){
c.server.update().then(function(response){
alert(c.data.troubleshooting);
//console.log(c.data.troubleshooting);
})
}}
and server as
(function() {
var gr = new GlideRecord('x_qune_ca_troubleshooting');
gr.initialize();
gr.insert();
var strSysID = gr.sys_id;
var strTroubleShootingNumber = gr.number;
gs.eventQueue('x_qune_ca.execute_analysis', gr, strTroubleShootingNumber, '');
gr.status = 'analyzing_cmdb_logs';
gr.update();
data.troubleshooting=gr.number;
})();
getting
[object Object]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2019 09:58 AM
Got t..need to use gr,getValue('number');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2019 10:58 AM
good, please mark answer correct/helpful, if it helpled you.
thanks.