How to add button in Service portal?

salu
Mega Guru

Hello,

We need to add a button like continue.Earlier we used add it by a macro variables but service portal it won't support.can some suggest an alternate method for it?

And also on click I need a generate a page which shows some information.In normal CMS we did it like UI pages through jelly script.Can someone help me on this.

The below image show what am exactly looking for

Thanks

Saranya

1 ACCEPTED SOLUTION
26 REPLIES 26

Hie Saranya,



I have already tried this long before but it is not working. As g_form is used for that form but there is no such form so I guess g_form is not working. We have to call a function from server script. Can You tell me how that can be done?


Hi Anubhav,



You requirement looks simple enough to implement by just creating UI actions on the incident table.   Here is the wiki doc for UI Actions if you are not familiar with it: UI Actions - ServiceNow Wiki



- Hardik Vora


Hi Hardik,



I am very much familiar with UI actions. Its not same as creating button in incident table. It is related to widgets. If you have any solution or hints how to do it, please help me.


In that case you can update the "Ticket Fields" widget with something similar to below example:



HTML:


                      <div><button type="button" class="btn" ng-click="btnClicked('reopen')">Reopen</button></div>


                      <div><button type="button" class="btn" ng-click="btnClicked('resolve')">Resolve</button></div>


                      <div><button type="button" class="btn" ng-click="btnClicked('close')">Close</button></div>



Client Script:


function($scope) {


  $scope.btnClicked = function(act) {


      alert("Action Clicked: "+act);


        // do something


  };


}



- Hardik Vora


Hi Hardik,



As I have written that I have already added some buttons like Resolve, Reopen and Closed, by I don't how to implement that. Like how to change the state of Incident to 'resolved' on clicking 'Resolved' button. I want to know that ---//do something--- thing only.