Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Automatically reload/refresh the page including value on the variables

Al-JhonV
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

Not applicable

Hi @Al-JhonV ,

 

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

Not applicable

Hi @Al-JhonV ,

 

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

Not applicable

Hi @Al-JhonV ,

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.