Module Click with Confirmation Dialog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2024 09:16 AM - edited 02-21-2024 11:31 AM
I have a use case where the principal wants to display a confirmation dialog to the fulfiller once they click the module in the filter navigator and if the fulfiller confirms then go to the incident form while applying a template: Lost/Stolen+Asset
I have tested the following in DEV as the Link type URL from arguments with the following supplied arguments:
javascript:confirm('Are you sure you want to do this?') ? window.location.href = 'now/nav/ui/classic/params/target/incident.do?sys_id=-1&sysparm_template=Lost/Stolen+Asset' : false
This triggers the confirmation dialog and if the user confirms it creates the incident using the supplied template but it redirects them to the new incident form rather than the created incident record form which is not ideal.
I suspect it is because I am using global window.location property.
Update: if I change it to (below) the following, it shows the correct record but opens it in a new window, thus losing the UI and navigation.
javascript:confirm('Are you sure you want to do this?') ? window.location.href = '/incident.do?sys_id=-1&sysparm_template=Lost/Stolen+Asset' : false
If you were to do this, how would you go about it?