- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi,
There is a button that appears in the Risks related list on the Project Form called "Create from Library". When you click it you can add a risk to the project from the risk library. A modal pops up like this:
I've added a new "Related List Declarative Action" (on sys_declarative_action_assignment) and, to test, I just set it to give me a console log.
The button appears in the right place on the project workspace like this:
But when I click it, I get an error saying Failed to execute action. Please contact your administrator.
This is my declarative action:
Note that I am not able to select the project workspace in the workspace field. The only option there is "Agent Workspace".
What am I doing wrong?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hello, I have just created the same example for other table to test and I have no problems as long I have the function onClick()
I did with alert, but it also worked with console.log :
this is the code :
function onClick() {
alert("this is a test");
console.log("test");
}
If I remove the function onClick() with the same code I do get the error you are mentioning :
Can you check if you have the function and give it a try ?
I hope this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hello, I have just created the same example for other table to test and I have no problems as long I have the function onClick()
I did with alert, but it also worked with console.log :
this is the code :
function onClick() {
alert("this is a test");
console.log("test");
}
If I remove the function onClick() with the same code I do get the error you are mentioning :
Can you check if you have the function and give it a try ?
I hope this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Thank you. I can now get the popup to appear.
Unfortunately, since posting, it has become clear that I need to set it up as a UXF Client Action (which doesn't work!!).
Either way, you solved the problem I posted. Thank you again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I agree with what @Diogo Ramos mentioned.
I just checked few OOTB Related list actions and it has the onClick function, add that and it should work fine
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
