we want to hide form action of create incident from form context menu of SIR form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
we want to hide form action of create incident from form context menu of SIR form after one incident is created from the security incident ?Is there any solution for this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
I have added this logic in condition , but it is not working in SIR workspace , still create incident form action is coming after one incident is created
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Lets try with on-load client script removal as a fallback If you cannot change the workspace action or if the action is injected by a plugin, hide it on the client after the form loads. Example
function onLoad() {
// Wait until the form model is ready and then check the incident field
if (g_form && g_form.getValue('incident')) {
g_form.removeContextAction('create_incident'); // replace with your actual action name siva
}
}
This is a fallback and may require tweaking for the workspace environment. In some Now Experience apps you need to hook into the view model instead of g_form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
I couldn't find any documentation for this method.
Could you please share that?
May be it's not documented but did it work for you? Please share screenshots for the same so that it helps to know if it works in workspace.
g_form.removeContextAction
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
please share screenshots of that button and what change you did
are you sure it's Normal UI action OR it's a form Action
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Ok sure I will share screenshot
