Refresh/Reload the from from an UI Page

Uma13
Kilo Contributor

Hi All,

How to reload a form  from an UI Page.

There is an OOB UI Page 'assessment_thanks' I want to reload/refresh the Risk Form on displaying this message "You have completed this Assessment" from this ui page

 

<div class="end-note" data-form-title="$[gs.getMessage('You have completed this {0}', '${jvar_assessment_type}')]">
<g2:evaluate var="jvar_item" jelly="true" expression="
gr = new GlideRecord('asmt_metric_type');
gr.addQuery('sys_id', jelly.sysparm_assessable_type);
gr.query();
" />
<j2:if test="$[gr.next()]">
<!-- end_note may contain HTML formatting -->
<g2:no_escape>$[NS:gr.end_note]</g2:no_escape>
</j2:if>
</div>

Thanks,

Uma

 

1 ACCEPTED SOLUTION

AnirudhKumar
Mega Sage
Mega Sage

In the Client script field of your UI Page, add the below code:

setTimeout(refresh, 5000);//Wait 5 seconds before reload

function refresh() {
    location.reload();
}

 

You may decrease/increase the wait time before the delay. I have used 5000 (5 seconds)

View solution in original post

1 REPLY 1

AnirudhKumar
Mega Sage
Mega Sage

In the Client script field of your UI Page, add the below code:

setTimeout(refresh, 5000);//Wait 5 seconds before reload

function refresh() {
    location.reload();
}

 

You may decrease/increase the wait time before the delay. I have used 5000 (5 seconds)