In RITM When State is Closed Completed after 1 day it should be readOnly

nameisnani
Mega Sage

Hi,

 

1 .We have a requirement that in RITM form when state is selected as closed complete , after 1 day it should become Read only.

 

2. as similar we have request that when state is closed incomplete , closed skipped , then state field should be read only immediately . This one we achieved through UI Policy.     

 

i Need help in Point 1 .

 

Please help me on this .

 

@Saurav11 @kamlesh kjmar 

3 ACCEPTED SOLUTIONS

On your RITM form, press CTRL + SHIFT + J and execute below code, and share what's the alert msg you are getting

 

alert(g_scratchpad.closedDaysAgo)

 

kamleshkjmar_0-1669097501692.png

 

View solution in original post

@nameisnani 

 

What was the issue with the UI policy I has suggested earlier:-

 

In the UI policy change the script to below  and then try to test  it should work:-

 

function onCondition() {
  var fields = g_form.getEditableFields();
for (var x = 0; x < fields.length; x++) {
    g_form.setReadOnly(fields[x], true);
}
}

 

Saurav11_0-1669103714759.png

 

Please mark my answer as correct based on Impact.

View solution in original post

@nameisnani 

 

Remove closed complete option from selection in your OR condition of UI policy, as highlighted in below screen shot

 

kamleshkjmar_0-1669192172291.png

 

 

I hope this helps.


Regards,

Kamlesh

View solution in original post

24 REPLIES 24

@Saurav11 

 

how to change this to global

 

SunilKumarPadh_1-1669091452627.png

 

@nameisnani  While you are creating the Ui policy make sure your application is seleted as global:-

 

Saurav11_0-1669091531958.png

 

@Saurav11 

SunilKumarPadh_0-1669093106631.png

SunilKumarPadh_1-1669093124150.png

as per ur instructions i have made changes , will doing testing ,

 

when i select ritm state closed complete , incomplete , skipped , immediately it is become read only and it is jumping new ritm number which is not up to mark  

@nameisnani  This is a tested scenario, there is no reason it won't work. Please make sure you are testing right. Just to verify, could you please check the closed field value on list view of RITM. 

 

Open the list view of RITM >  include Closed field in your list view  > and hover over the value of the record which you are checking, does it say a day ago as shown below in the screen shot below

 

kamleshkjmar_0-1669094557393.png

 

I hope you understand this 'before 1 day' means when ticket closed time has crossed 24hrs of time, don't think of it date wise i.e. irrespective of time.

 

Regards,

Kamlesh

 

@kamlesh kjmar 

 

This is my tested one 

 

SunilKumarPadh_0-1669096230340.png

 

u can see here after 24hrs also state is editable 

 

SunilKumarPadh_1-1669096321353.png