The CreatorCon Call for Content is officially open! Get started here.

Automatically reload/refresh the page including value on the variables

Al-jhon
Kilo Sage

Hello all,

i experienced a strange issue in technical view where i completed the order of RITM and use the back button in browser to submit a new request using the same catalog item.
For example:
I am requesting to retire this pc:

Aljhon_0-1713930188010.png


after ordering i will click the back button on the browser to submit a new request:

Aljhon_2-1713930297413.png

 

and there are still value on the variables which is not correct because the PC variable is not visible even though the type of device has a value:

Aljhon_3-1713930333891.png

How to reload or refresh the page and clear all value? I tried using onLoad script but it is not working.
This case is not happening in SP view.
When i click go back button of the browser in ServicePortal view, all variables are have no any value and this is what i want to achieve in technival view.

Any ideas?

 

7 REPLIES 7

Kavita_Bhojane
Tera Guru

Hi @Al-jhon ,

 

Could you please share onLoad client script?

It should work with

 

g_form.clearValue('field_name');
g_form.clearOptions('field_name');

 

Please mark my answer helpful and accept as a solution if it helped 👍✔️

Thanks,
Kavita Bhojane

Kavita_Bhojane
Tera Guru

Hi @Al-jhon ,

 

Could you please share onLoad client script?

It should work with: 

g_form.clearValue('field_name');
g_form.clearOptions('field_name');

 

 

 

Please mark my answer helpful and accept as a solution if it helped 👍✔️

Thanks,
Kavita Bhojane

Community Alums
Not applicable

Hi @Al-jhon ,

That's strange. Can you try to check using this onLoad Client Script on catalog-

function onLoad() {
// Reset all variable fields to their default values or empty
g_form.clearValues();
}

Please mark as Accepted Solution if this solves your query .

Hello @Community Alums using OnLoad clientscript is not working when doing browser back button.