How do you set the OnClick values for buttons created using spModal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2019 01:32 PM
I am currently building a Modal that pops up when a user saves a record on the Service Portal. I have been using spModal.open to generate this modal. I want the button generated with the Modal to call a specific function when it is clicked. Is there a way to do this?
For clarity, I am referring to this line in the spModal.open function.
buttons: [
{label:'OK', primary: true}
]
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2025 04:16 PM
Hello,
1. Create buttons and assign some property like "primary".
2. Add the "actionButton" to the function.
3. Use the actionButton and the properties of the buttons for your logic.
You can copy the code from your out of the box "my-requests-v2" sp_widget.
Kind regards,
Sebastian