UI Action creating new records
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2025 10:04 AM
I am working on creating a UI Action form button
This action should first look at 8 different fields and make sure they are all populated. If any of them are not populated then it should display a message saying "All fields must be completed" and take no further action.
If all 8 fields are populated then there is some if/then logic to update a field and display a message. Once it updates the field and displays the message then no further action should be taken.
In both cases (if one or more fields isn't populated OR if all 8 fields are populated) it is acting as expected except that it then tries to create a new record. I don't want it to create a new record. How can I get this to stop?
The UI Action is set up as follows:
Table: dmn_demand
Action Name evaluate_risk_score
Active: checked
Show update: checked
Client: checked
List v2 Compatible: checked
Form button: checked
Onclick: onClick();
Condition: current.active == true && gs.hasRole("itil")
Script:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2025 10:59 AM
Hello @Tom Lapkowicz
What's event and where is showing Dialog function called and prevent default function written ?
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-03-2025 12:29 PM - edited 04-03-2025 12:44 PM
Hello @Tom Lapkowicz ,
I have created a UI Action with the exact same configuration as the one mentioned in your post, and pasted your script. I only replaced the field names because I don't have all these custom fields on my end.
Then I clicked this action on a Demand where some fields were empty and also on a Demand where everything was filled. In both cases the dialog pops up with either the missing information warning or the completion confirmation. When I closed it it just closed as expected and I was back on the Demand form - nothing else happened, no submit, no "new record", etc. And looking at the script I would also not expect anything else to happen.
So something else must be the cause of the issue. Can you please try deactivating this UI Action and creating a new one with the same script, but a different (and unique) "Action name"?
PS: the first three lines (with the "event") and the last "return" are not necessary.
PPS: Are you familiar with the OOTB assessment surveys that get assigned to the Stakeholders when a Demand gets moved to Screening? The default survey also has questions related to Risks, see below. Based on the answers the Demand scores, including risk, get calculated using configurable weightings. It seems you are trying to achieve something similar, so I thought of mentioning it.
Regards,
Robert