Refreshing Service portal

Community Alums
Not applicable

Hi,
When I open a catalog item in service portal page.
The issue is when the catalog item loads on the portal, then I have not entered any value in any variable field, and at the time of refreshing the page I am getting warnings "Changes you made may not be saved." 

Thanks in Advance

Utsav

2 REPLIES 2

Gunjan Kiratkar
Kilo Patron
Kilo Patron

Hi @Community Alums  ,

That is expected behaviour for all browsers, It shows that message to let you that once you refresh the page before saving it then everything will lost and you will have to fill those fields again.

Let me know if you need anything else.


Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy

SwarnadeepNandy
Mega Sage

Hello @Utsav JAISWAL,

 

This could be a possible cause and solutions for this issue are:

  • Check if your catalog item variables have the Read only property checked and if they have any Default value script or OnLoad client script that sets their values.
  • If yes, then you need to modify the script to use the g_form.setValue() method instead of the current.value or current.variables.value methods. For example, instead of writing:

 

current.variables.my_variable = "some value";​

 

You should write:

 

g_form.setValue("my_variable", "some value");

 

  • This will ensure that the variable values are saved correctly and do not trigger the warning message.
  • You can also refer to this article for more details and examples on how to fix this issue.

 

Hope this helps.

 

Kind Regards,

Swarnadeep Nandy