How to get the current action name of the form through server script in widget in service portal?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2022 10:50 PM
Hi Team,
How to get the current action name of the form through server script in widget in service portal?
Thanks,
Yesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2022 02:05 AM
Hi
Do you have any other solution for this? I have tried lot of time by using input.action and input also. If i am trying to log a message what is there in input object. It is logging as Undefined only. Don't know what to do.
Thanks,
Yesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2022 02:37 AM
Hi team,
Here is the Client script:
function($scope, $location, $window) {
var c = this;
$scope.query = function(stateValue) {
if (stateValue == "query") {
c.data.action = stateValue;
c.server.update().then(function() {
$window.location = "?id=rfq_form&table=x_request_for_quotation&sys_id=" + c.data.sys_id;
});
}
}
}
Here is the server script:
(function($sp, input, data, gs) {
gs.addInfoMessage(input);//getting message as undefined
gs.addInfoMessage('outside');//Logging this message
if(input) {
gs.addInfoMessage('input');//Not getting this message
if(input.action == 'query') {
gs.addInfoMessage('input action');
var gr= new GlideRecord('x_request_for_quotation');
gr.addQuery('sys_id', $sp.getParameter("sys_id"));
gr.query();
if (gr.next()) {
gr.u_rfq_status = 'query';
gr.update();
}
}
}
})($sp, input, data, options, gs);
Thanks,
Yesh