Iterate Records
Hi again!
I have some doubt if I understand your task correctly... I thought you try to iterate through the fields of the form but it's actually not your case, isn't it?
Please correct me if I mistaken, do you want to iterate through the items of the list with the help of these buttons? Pushing a previous button opens an Edit form of the previous item of the parent list and pushing a next button - next item? Will the current form be saved after the redirection if any changes applied? Or it's only for Display forms?
Please provide more details to your request to help us suggest a proper solution. The screenshots are very welcome!
I have some doubt if I understand your task correctly... I thought you try to iterate through the fields of the form but it's actually not your case, isn't it?
Please correct me if I mistaken, do you want to iterate through the items of the list with the help of these buttons? Pushing a previous button opens an Edit form of the previous item of the parent list and pushing a next button - next item? Will the current form be saved after the redirection if any changes applied? Or it's only for Display forms?
Please provide more details to your request to help us suggest a proper solution. The screenshots are very welcome!
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Dear CW,
Technically it's very easy to redirect user to the next item or previous item in the list, you can simply replace the ID in the URL. For example, this code would open the same form for the item with next ID (e.g. 1 2)
But there is a big issue here. It will give an error if the item does not exist. And it could've been simply deleted or never created yet (last item in the list).
Now, working around this is much harder. You'll need to send JS requests to the List, retrieve what items are available in the list, and if there are some, then redirect. This article should be helpful.
Now, we can most likely help with the process, but we first need to discuss it, so if you are interested, please, write us - support@spform.com
Technically it's very easy to redirect user to the next item or previous item in the list, you can simply replace the ID in the URL. For example, this code would open the same form for the item with next ID (e.g. 1 2)
Code: Select all
var id = fd.getUrlParam(window.location.href, 'ID');
var nextID = Number(id) + 1;
var url = window.location.href.replace("ID=" + id, "ID=" + nextID);
window.location.href = url;
Now, working around this is much harder. You'll need to send JS requests to the List, retrieve what items are available in the list, and if there are some, then redirect. This article should be helpful.
Now, we can most likely help with the process, but we first need to discuss it, so if you are interested, please, write us - support@spform.com
Cheers
-
- Information
-
Who is online
Users browsing this forum: No registered users and 11 guests