Iterate Records

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
CW
Posts: 5
Joined: Fri Dec 14, 2018

02 Jan 2019

Is it possible to add two buttons at the top of a form to iterate back a record or go to next record? Such as <<Previous Record Next Record>>.

I know there is a framework example for previous, but that's just like the back button on a browser.

TX

CW

User avatar
AlexZver
Posts: 232
Joined: Mon Aug 27, 2018

04 Jan 2019

Hi!

We are working on your issue and soon will give you an answer.

User avatar
AlexZver
Posts: 232
Joined: Mon Aug 27, 2018

04 Jan 2019

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!

CW
Posts: 5
Joined: Fri Dec 14, 2018

04 Jan 2019

Hi. Yes iterating through records, not fields. Iterate the way you would in list form scrolling down through the list items.

My idea is pretty much the same as the record navigating function of MS Access.

User avatar
AlexZver
Posts: 232
Joined: Mon Aug 27, 2018

05 Jan 2019

Hi!

I'm sorry, I still have a slighted vision of your request... More details would be much appreciated. Could you please provide a screenshot of functionality you want to achieve?

CW
Posts: 5
Joined: Fri Dec 14, 2018

05 Jan 2019

Sure thing. I've included the screen shots.

Song (Chart) list
ChartList.png
ChartList.png (72.13 KiB) Viewed 2341 times
View Form of a Record
SelectedSong.png
SelectedSong.png (40.75 KiB) Viewed 2341 times
View with Next/Prev Navigation buttons
PrevNext.png
PrevNext.png (79.15 KiB) Viewed 2341 times

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

07 Jan 2019

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 :arrow: 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;
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
Cheers

CW
Posts: 5
Joined: Fri Dec 14, 2018

07 Jan 2019

Of course, that makes sense. I'm not a coder like you so I thought it may be simpler.

No big deal, thought it was something to try out but not worth spending time on.

Thanks for the suggestion though. Maybe one day, when I'm bored I can try it out.

CW

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 11 guests