UI action throwing error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
Hi all,
I might have the most stupid question, which I hope you can explain the reason. I'm trying to create a Client callable UI action with both client side and server side code in it. The setup is like this:
Where the code written is (currently just some test code):
function onCLickConvertGsr() {
var answer = confirm("Are you sure?");
if (answer) {
gsftSubmit(null, g_form.getFormElement(), 'ConvertGsr');
}
}
if (typeof window == 'undefined') {
ConvertGsr();
}
function ConvertGsr() {
var incGr = current;
incGr.state = 8;
}
When trying to save this i get this error:
Can one of you explain the reason for this?
@Ankur Bawiskar - do you might have a good idea here?
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
did you try creating fresh UI action?
Also you can directly assign the value using current and you forgot to update
Ensure no before update BR stops the form submission
function ConvertGsr() {
current.state = 8;
current.update();
}
💡 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
Hi @Ankur Bawiskar ,
thanks for the comment. Other than the minor corrections to the server side, have you then seen such an issue before or having any knowledge around why such an issue could occur?
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
Nope, haven't seen this issue.
Could be an intermittent connection or instance issue.
Anyhow it's PDI and PDIs are highly unstable and no guarantee on their behavior.
Try clearing instance cache using cache.do
💡 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