Reload form when update record

Nuno Oliveira
Mega Guru

Hi there,

I have this requirement which says if someone updates a SC Task on the RITM related list for the SC Tasks, it needs to set one of the variables to read only. I already have a client to set this variable read only on load, however I need to set it when the user changes for example, the SC Task state to Close complete. What is your advise for this?

 

I was trying to reload the RITM form from the list update of the task, but it didn’t worked.

 

Best Regards

1 ACCEPTED SOLUTION

Abhijit4
Mega Sage

Hi,

After reading your further comments, what I understood is, you are struggling to reload form when someone updates field in SCTASK related list on RITM form so I found below solution for you.

You can write onCellEdit client script on catalog task form to reload RITM form whenever user updates something in SCTASK related list.

Please find script and details below (I have written client script for assignment group, you can change based on your requirement)

find_real_file.png

Let me know if you have any further queries.

Please mark this as Correct or Helpful if it helps.

Thanks and Regards,
Abhijit
Community Rising Star 2022

By marking my response as correct or helpful, you contribute to helping future readers with similar issues.
Regards,
Abhijit
ServiceNow MVP

View solution in original post

5 REPLIES 5

sonali panda1
Kilo Sage

Can you please elaborate a little more and what have you done in terms of script. I am not getting clarity on the readonly part.

Hi Sonali,

 

Yes I can.

So I have a requirement to set read-only of a variable in the RITM form if a task changes, eg the state to close complete. And that part is complete, I have a client script working onLoad in RITM that checks if that task is already complete, and if it is, the client sets the variable to read-only. The problem is that if the user updates the task state in the related list, and I need to implement a way that if the user updates the task state in the related list, the variable is set to read-only without the user need to reload the page. Something like, the user updates the state of the task, and it triggers a page reload automatically to run the onLoad client.

 

Best Regards

Hi,

 

You cannot make RITM field as read only while changing the state value of related Task from the list view.

 

As a workaround you can restrict the user from changing the field values from the list view on Task.

 

Regards,

Sourabh 

Abhijit4
Mega Sage

Hi,

After reading your further comments, what I understood is, you are struggling to reload form when someone updates field in SCTASK related list on RITM form so I found below solution for you.

You can write onCellEdit client script on catalog task form to reload RITM form whenever user updates something in SCTASK related list.

Please find script and details below (I have written client script for assignment group, you can change based on your requirement)

find_real_file.png

Let me know if you have any further queries.

Please mark this as Correct or Helpful if it helps.

Thanks and Regards,
Abhijit
Community Rising Star 2022

By marking my response as correct or helpful, you contribute to helping future readers with similar issues.
Regards,
Abhijit
ServiceNow MVP