- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2022 12:22 AM
Hi,
I have UI Action "Create Request" as related link on Interaction form. My requirement is to open a request on click of UI Actio and also to close that interaction as well. The request is getting open but the state is not getting closed. Below is the script i have written:
Action name : ws_create_req
Show update: checked
Client: checked
Onclick: OpenReq()
Condition: current.state= ='new'||current.state=='work_in_progress'
Script:
function OpenReq()
{
current.state = "closed_complete";
current.update();
var url= 'com.glideapp.servicecatalog_cat_item_view.do?v=sysparam133192332';
g_navigation.openPopup(url);
}
The state is not getting set. PLease help me in this regard.
Thanks!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2022 01:30 AM
Hello,
I implemented the solution for state not getting closed. It worked!
Below is the screenshot for reference:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2022 12:26 AM
Hello,
current.state = "closed_complete"; doesn't seem correct , can you check backend value of close complete and set it accordingly, generally it should be integer
Regards
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2022 12:27 AM
Hi,
Duplicate question.
You already asked this question few days ago and I responded there with the solution.
Any reason you created 1 more question?
Open the specific record producer when the UI action is clicked
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2022 01:30 AM