Page 1 of 1

Redirect from Edit- to Displayform depending on current data set

Posted: 23 Mar 2017
by gaj
Depending on the current Status value i want to redirect from Editform to the Displayform.
Currently I´m using following JS in the Editform:

var statusindex = fd.field('VI_Status').control()._el().find('select')[0].selectedIndex;

if (!statusindex == 0) {
fd.openForm('/...._DisplayForm.aspx');
}

My Problem is that first the Editform is loading completely (it´s not very fast!) and then the Displayform is loaded!!

Is there a way to redirect acuratly before loading the Editform (like the functionality for redirecting user-groups) ?

I´m using SharePoint Online and only have "form set´s" aviailable which i already using here.

thx for helping me.

Re: Redirect from Edit- to Displayform depending on current data set

Posted: 24 Mar 2017
by Dmitry Kozlov
Hi,
Put an HTML-control on top of your form, switch CDATA property to False and insert the following content:

Code: Select all

<script type="text/javascript">
	<xsl:if test="@Status='Value'">
	fd.openForm('/');
	</xsl:if>
</script>
Replace 'Status' with the internal name of your Status field and 'Value' with its value that causes the redirection.