- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2025 11:51 PM
Dear experts,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-09-2025 01:28 AM
Hi Shivalika, thanks for the reply but I managed to solve the issue using my approach as below:
So I have created two new button one is Save as Draft and one is Submit to Assigned and also a new flag field in the risk event form called u_submitted.
Save as Draft code and condition:
Condition:
current.state == 1 && !current.u_submitted
Script:
current.assigned_to = '';
current.update(); // Use update so record isn't considered "submitted"
action.setRedirectURL(current); // Stay on the same record after save
Submit to Assigned:
Condition:
(current.assigned_to != null || !gs.nil(current.assigned_to)) && current.state == 1 && !current.u_submitted
Script:
current.u_submitted = true;
if (current.isNewRecord()) {
current.insert();
} else {
current.update();
}
action.setRedirectURL(current);
And for the global Ui action I did not delete or remove but added in one condition which is to exclude the sn_risk_advanced_event table only which is this condition:
current.getTableName() != 'sn_risk_advanced_event'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-09-2025 01:53 AM
It will redirect to all the risk events opened by the user, but yes the record is saved but not assigned to anyone and that is what i wanted the result to be.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-09-2025 01:57 AM
Hello @ChuanYanF
Then that's what I have also done, in the referenced screenshots. You can accept my solution also , it's 100% working as seen in screenshots. I thought you didn't want to save 😊. But then it's fine.
Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-09-2025 12:33 AM
Hi @ChuanYanF
As a process consultant, you might want to ask the client about the value they are looking to achieve. I understand you have a use case, but is this the only valid way to solve the issue? Creating custom UI actions and replacing them with global or out-of-the-box UI actions could lead to problems during upgrades and in the future when maintenance is required. Therefore, I wouldn't recommend creating two custom UI actions with the same name as needed. You should explore alternative solutions. Avoid increasing technical debt. You may find a solution now, but consider the long-term impact, not just the immediate fix
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-09-2025 01:30 AM
Thks for the advise Atul, I am grateful for your words of wisdom and your experience sharing but this is what we have come to a conclusion after getting their requirements. So this is all we can do is to follow their requirements in the meantime.