How to get the current action name of the form through server script in widget in service portal?

Yesh
Tera Contributor

Hi Team,

How to get the current action name of the form through server script in widget in service portal?

Thanks,

Yesh

6 REPLIES 6

Yesh
Tera Contributor

Hi @Sagar Pagar ,

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

Yesh
Tera Contributor

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