- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 04-12-2020 03:09 AM
In widget client script, if you are trying to take an input from the user using spModal.Prompt you must have ended with a dialog where there is input box but there is no label along with it but only *, that seems very odd.
you must have also tried below knowledge articles which are near to the solution; but that is not satisfactory.
1) How to use spModal.prompt; Shows no label, but * alone
2) How to put label with prompt; Shows label but not where we exact want.
https://developer.servicenow.com/dev.do#!/reference/api/orlando/client/SPModal-API
3) Working Solution: The label comes as expected
We used the solution (2) but modified the JSON parameter for open method, used the "label" instead of "message", as below...
spModal.open({
title: 'Give me a name',
label: 'Please type name here...',
input: true,
value: c.name
}).then(function(name) {
c.name = name;
})
Regards
Chirag A
- 2,956 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
var st_subSt = {
"Active":"in_effect",
"amended":"superseded",
"Draft":"draft",
"Expired":"expired",
"in_approval":"internal_approval_accepted",
"In Review":"internal-review",
"In Signature":"partially-signed",
"renewed":"renewed",
"terminated":"terminated"
};
var rep_st = {
//"Draft":["5~Active","5~In Review","5~in_approval","5~terminated"],
"null":["9~Active","15~In Signature","15~amended","15~renewed"]
//"In Review":["21~In Review"],
//"in_approval":["5~in_approval"],
//"Active":["4~Active"],
//"terminated":["1~terminated"],
//"In Signature":["3~In Signature"]
};
rep_st = {};
var utl = new x_aaven_avclm.common_aavenir_utilities();
for(prop in rep_st){
var g = new GlideRecord('ast_contract');
g.addEncodedQuery('x_aaven_avclm_lifecycle_status.state_event=' + prop);
g.orderby('sys_created_on');
g.query();
var up = rep_st[prop];
for(var i =0; i< up.length; i++){
var rec = parseInt(up[i].split('~')[0]);
for(var j = 1; j<=rec; j++){
if (g.next()){
utl.setStatusSubStatusOfContract(g,up[i].split('~')[1], st_subSt[up[i].split('~')[1]]);
g.update();
}
}
}
}
var gr = new GlideRecord('ast_contract');
gr.query();
var st_cnt = {};
while(gr.next()){
var s = gr.x_aaven_avclm_lifecycle_status.state_event.getValue();
if (!st_cnt[s])
st_cnt[s] = 0;
st_cnt[s] = st_cnt[s] + 1;
}
for(prop in st_cnt){
st_cnt[prop] = [st_cnt[prop] + '~' + prop];
}
gs.log("Summary: \n\n" + JSON.stringify(st_cnt).replace(/,/g,',\n'));
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Is there a way we can make input as multi line text ?