- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2020 08:04 AM
I created a onload catalog client script with the following script(note: not in the widget)
function onLoad() {
spModal.open({
title: 'Test.',
message: "ACknowledge before proceeding",
size: "md",
buttons: [
{label:'I Acknowledge', primary: true},
//{label:'Cancel', primary: false}
]
}).then(function(ans){
if (ans.label == "I Acknowledge"){
//alert('party');
}
});
}
This is how the popup comes up during catalog item form load.
Need to remove close button(x) which is at right corner.
Note: this is not on widget , the script which i wrote is onload catalog client script
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2020 04:20 AM
Hi Prem,
I have written this and works:
function onLoad() {
spModal.open({
title: 'Test.',
message: "Acknowledge before proceeding",
backdrop: 'static',
size: "md",
buttons: [
{label:'I Acknowledge', primary: true},
]
}).then(function(ans){
if (ans.label == "I Acknowledge"){
//alert('party');
}
});
var checkExist = setInterval(function() {
if (top.document.getElementsByClassName('close pull-right')[0]) {
clearInterval(checkExist);
var x = top.document.getElementsByClassName('close pull-right')[0];
x.style.display = "none";
}
}, 100); // check every 100ms
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2020 08:57 AM
I don't think you can turn that off.
Vinod Kumar Kachineni
Community Rising Star 2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2020 09:33 AM
Hi
If this is for Service Portal (i.e. https://<your-instance-id>.service-now.com/sp), you can hide it via css.
From the platform navigator, navigate to "Service Portal --> Portals", click on your portal ("Service Portal", if it's for the stock sp). On the portal record, go to the CSS Variables section, and add the below css and it should work.
.modal-header .close {
display:none;
}
Please refer to the screenshots below:
Thanks & Regards,
Rishabh Jha
Aavenir (https://www.aavenir.com/)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2020 10:08 AM
Hi Rishabh,
Actually i wrote the script in catalog client script not in widget's client script.
i want the message to be visible on load of a particular catalog item.
Is it possible to use CSS in catalog client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2020 10:44 AM
Hi
The css in my answer above will be applied to the portal, so it doesn't matter where have you defined the spModal.
If you're using the service portal to view the catalog item, it'll work.
Thanks & Regards,
Rishabh Jha
Aavenir (https://www.aavenir.com/)