- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2018 01:07 PM
Hi,
I've a customer requirement to add an Update & Next UI Action to a form, so that the user is able to select the desired state in a record then update and move to the next record in one click.
Completing the Update part isn't a problem as I've recycled the Update button on Task, however I'm having problems getting it to move to the next record after updating.
Has anyone had any experience of doing this, or would anyone know how I'd go about scripting the 'open next record' part.
Thanks in advance.
Mike
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2018 01:24 AM
Hi mikeinsleytu,
Try this script for "next" UI Action button.
var gr= new GlideRecord("<Your table name>");
gr.addQuery("number",'>',current.number);
gr.query();
gr.next();
current.update();
action.setRedirectURL(gr);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2018 01:24 AM
Hi mikeinsleytu,
Try this script for "next" UI Action button.
var gr= new GlideRecord("<Your table name>");
gr.addQuery("number",'>',current.number);
gr.query();
gr.next();
current.update();
action.setRedirectURL(gr);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2018 02:27 AM
HI Karishma,
Thanks for that, it worked great. Here's what I did:
var gr = new GlideRecord('<table name>);
gr.addQuery("number" , '>' , current.number);
gr.addQuery('active' , true);
gr.orderBy('number');
gr.query();
gr.next();
current.update();
action.setRedirectURL(gr);
I also added the conditions from the OOTB Update ui action, mainly because updating the current record needs to preform in the same way.
current.isValidRecord() && current.canWrite() && gs.getProperty('glide.ui.update_is_submit') != 'true'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2023 06:20 PM
Hi team
As the list from where you open a form may have filter conditions.
So the next record would not be simply number +1.
Any advise for such case?