Redirect from Edit- to Displayform depending on current data set

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
gaj
Posts: 40
Joined: Wed Feb 01, 2017

23 Mar 2017

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.

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

24 Mar 2017

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.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest