Redirect on Save
Good Morning,
I am trying to add a function to a New and Edit Form so that on submit, based on certain conditions it will redirect on save to a specific New Form (from the same List)
My unconditional redirect code is as below: -
This works fine as long as I navigate directly to the initial New form, however we are encoding some data into the initial URL of the form to pass through data from a previous form and in doing so this seems to break the save function.
The initial clean URL looks like this: -
The initial encoded URL like this: -
When trying to save the form the item is saved to the list but with a number of fields blank and the New Form fails to open with the following error displayed: -
"Invalid data has been used to update the list item. The field you are trying to update may be read only. "
I'm sure its a fairly simple fix, but I just can't get my head around it...
Thanks
I am trying to add a function to a New and Edit Form so that on submit, based on certain conditions it will redirect on save to a specific New Form (from the same List)
My unconditional redirect code is as below: -
Code: Select all
fd.onsubmit(function() {
fd.sourceFormParam('fd_Task_bb60fbb4-0754-4de2-bb50-1eb6565a2b1a_NewForm.aspx?');
return true;
});
The initial clean URL looks like this: -
Code: Select all
https://xxxxxxxxxx.sharepoint.com/ERP/Lists/Sales%20Activities/fd_Task_bb60fbb4-0754-4de2-bb50-1eb6565a2b1a_NewForm.aspx?
Code: Select all
https://xxxxxxxxxx.sharepoint.com/ERP/Lists/Sales%20Activities/fd_Task_bb60fbb4-0754-4de2-bb50-1eb6565a2b1a_NewForm.aspx?CompanyNameId=474&CompanyName=xxxxxxxx&ContactNameId=&AddressNameId=
"Invalid data has been used to update the list item. The field you are trying to update may be read only. "
I'm sure its a fairly simple fix, but I just can't get my head around it...
Thanks
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Dear Tony,
If passing parameters in the URL breaks functionality of the new form, I would suggest to store the same data in localStorage instead, you can also use it to retrieve data when the form opens.
If passing parameters in the URL breaks functionality of the new form, I would suggest to store the same data in localStorage instead, you can also use it to retrieve data when the form opens.
Cheers
-
- Information
-
Who is online
Users browsing this forum: No registered users and 11 guests