Trigger a function onClick of button over modal in service portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2022 06:35 AM
Hi All,
I have two buttons over my modal in service portal 'ok' and 'cancel'. Once clicked on 'Ok' I have to do some changes over other table. And on click of 'cancel' I have to do nothing. I am thinking to keep the first logic inside a function and call it onClick of 'ok' button that is embedded inside modal. Could you please guide me on how to call a function on click of a button that is inside the modal.
I am attaching a small snippet of my modal code:
var Details = {};
Details.title = 'Hello';
Details.widget = 'selector';
Details.buttons = [{
label: 'Ok',
primary: true
},
{
label: 'Cancel',
primary: true
}];
Details.widgetInput = {
sys_id: 'c.data.sysId'
};
spModal.open(Details).then(function(data) {
console.log('Hi');
});
Thanks in Advance,
Sruthi.
- Labels:
-
Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2023 12:04 AM
Hi sruthi22,
Did you get the solution for this? If yes, could you please share the snippet that worked for you.
I do have same requirement to achieve.
Thanks in Advance!
Regards,
Arpitha G