Setting state to close is not working in UI Action

SK41
Giga Guru

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!

1 ACCEPTED SOLUTION

SK41
Giga Guru

Hello,

I implemented the solution for state not getting closed. It worked!

Below is  the screenshot for reference:

find_real_file.png

View solution in original post

3 REPLIES 3

Musab Rasheed
Tera Sage
Tera Sage

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

Please hit like and mark my response as correct if that helps
Regards,
Musab

Ankur Bawiskar
Tera Patron
Tera Patron

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

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

SK41
Giga Guru

Hello,

I implemented the solution for state not getting closed. It worked!

Below is  the screenshot for reference:

find_real_file.png