April 18, 2024

SamTech 365

PowerPlatform, Power Apps, Power Automate, PVA, SharePoint, C#, .Net, SQL, Azure News, Tips ….etc

How to redirect user back to list item form when list item is edited in SharePoint 2007?

You can create a custom form by with SharePoint Designer then customize the OK Button to save and redirect to the display view. To create custom edit form using SharePoint Designer here is a full instructions on how to do thi http://office.microsoft.com/en-ca/sharepoint-designer-help/create-a-custom-list-form-HA010119111.aspx

Once you done this then find this line on the source code of you new page

<xsl:decimal-formatNaN=""/><xsl:paramname="dvt_apos">'</xsl:param><xsl:variablename="dvt_1_automode">0</xsl:variable>

and append this line below

<xsl:paramname="ListItemId">0</xsl:param>

“this will make the id of the current item accessible by the button” replace both of your OK buttons

<SharePoint:SaveButtonrunat="server"ControlMode="Edit"id="savebutton1"/>

whit this one

<inputtype="button"value="OK"name="btnSave"onclick="javascript:{ddwrt:GenFireServerEvent(concat('__commit;__redirect={dispform.aspx?id=',$ListItemId,'}'))}"/>

Save and test :). You don’t necessarily have to replace your OK buttons for this one you can also add this extra button and instead of calling it OK call it something like Save and display and let the user decide what to do (just and idea)

Hope this helps!

You can create a custom form by with SharePoint Designer then customize the OK Button to save and redirect to the display view. To create custom edit form using SharePoint Designer here is a full instructions on how to do thi http://office.microsoft.com/en-ca/sharepoint-designer-help/create-a-custom-list-form-HA010119111.aspx

Once you done this then find this line on the source code of you new page

<xsl:decimal-formatNaN=""/><xsl:paramname="dvt_apos">'</xsl:param><xsl:variablename="dvt_1_automode">0</xsl:variable>

and append this line below

<xsl:paramname="ListItemId">0</xsl:param>

“this will make the id of the current item accessible by the button” replace both of your OK buttons

<SharePoint:SaveButtonrunat="server"ControlMode="Edit"id="savebutton1"/>

whit this one

<inputtype="button"value="OK"name="btnSave"onclick="javascript:{ddwrt:GenFireServerEvent(concat('__commit;__redirect={dispform.aspx?id=',$ListItemId,'}'))}"/>

Save and test :). You don’t necessarily have to replace your OK buttons for this one you can also add this extra button and instead of calling it OK call it something like Save and display and let the user decide what to do (just and idea)

Hope this helps!