Service portal Information
Service Portal
A. Widget
A widget is an Directive, is a reusable template that can be configured to
----Display Data
-----Enables users to perform a function
-----Enables users to access a service.
B.Class's in Widget
1. spModal class
is available in Service Portal client scripts
way to show alerts, prompts, and confirmation dialogs
HTML Template:
<div>
Enter Incident Number:
<input type="text" name="fname" ng-change="c.my(c.data.number)" ng-model="c.data.number" value="{{data.number}}"><br>
<button ng-click="c.onAlert()" class="btn btn-default">
Request short description
</button>
<div>{{data.shortt}}</div>
</div>
Client Script:
var c = this;
// c.server.update();
// };
c.onAlert=function(){
spModal.alert('Please request the short description').then(function (answer) {
c.simple = answer;
c.server.update();
});
};
}
Server Script:
(function(){
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */
//data.number="";
//data.short="888";
//if(!input){
var gr=new GlideRecord("incident");
gr.addQuery("sys_id","5bad80f7dba0a3009df7fe1b68961903");
gr.query();
if(gr.next()){
data.number=""+gr.number;
data.shortt=""+gr.short_description;
}
if(input){
// data.number="pavan";
var gr1=new GlideRecord("incident");
gr1.addQuery("number",input.number);
gr1.query();
if(gr1.next()){
data.number=""+gr1.short_description;
data.shortt=""+gr1.short_description;
}else{
data.number="Not Found";
data.shortt="Not Found";
}
}
//}
})();
A. Widget
A widget is an Directive, is a reusable template that can be configured to
----Display Data
-----Enables users to perform a function
-----Enables users to access a service.
B.Class's in Widget
1. spModal class
is available in Service Portal client scripts
way to show alerts, prompts, and confirmation dialogs
HTML Template:
<div>
Enter Incident Number:
<input type="text" name="fname" ng-change="c.my(c.data.number)" ng-model="c.data.number" value="{{data.number}}"><br>
<button ng-click="c.onAlert()" class="btn btn-default">
Request short description
</button>
<div>{{data.shortt}}</div>
</div>
Client Script:
var c = this;
// c.server.update();
// };
spModal.alert('Please request the short description').then(function (answer) {
c.simple = answer;
c.server.update();
});
};
}
Server Script:
(function(){
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */
//data.number="";
//data.short="888";
//if(!input){
var gr=new GlideRecord("incident");
gr.addQuery("sys_id","5bad80f7dba0a3009df7fe1b68961903");
gr.query();
if(gr.next()){
data.number=""+gr.number;
data.shortt=""+gr.short_description;
}
if(input){
// data.number="pavan";
var gr1=new GlideRecord("incident");
gr1.addQuery("number",input.number);
gr1.query();
if(gr1.next()){
data.number=""+gr1.short_description;
data.shortt=""+gr1.short_description;
}else{
data.number="Not Found";
data.shortt="Not Found";
}
}
//}
})();
Comments