Skip to main content

Notifications

Community site session details

Community site session details

Session Id : L97ev4M33c6gXZXWSkGSHF
Power Apps - Power Apps Pro Dev & ISV
Unanswered

Save form and load next record

Like (0) ShareShare
ReportReport
Posted on 30 Nov 2021 00:58:38 by 306

In my model-driven app, I have a form with a custom ribbon button that changes a value and saves the record.  What I would like it to also do is move to the next record in the view list that the form was opened from.  Does anyone know if this is possible?

 

Something like this would be ideal:

 

formContext.data.entity.save("saveandnext");

  • tschopp Profile Picture
    306 on 09 Dec 2021 at 17:37:36
    Re: Save form and load next record

    @cchannon - Thanks for the idea.  I presented that as a possible solution to our stakeholders, and we may go with it.  But their concern is it's 2 clicks instead of 1.  This seems nitpicky to me, but they do a high volume of data entry.

  • cchannon Profile Picture
    4,702 Super User 2025 Season 1 on 09 Dec 2021 at 12:23:26
    Re: Save form and load next record

    MSFT OOB functionality to the rescue!

     

    There is a new button in the ribbon (not sure when it got added, to be honest, I just noticed it this morning) and this button opens a Left side panel with the view you came from to this record, so if you have your users click this button, they will get a scrollable left list of their view and can easily just hit Save, then click the next row in the view. Screenshot below - Red circles the button, Green circles the new left list.

    cchannon_0-1639052474084.png

     

  • cchannon Profile Picture
    4,702 Super User 2025 Season 1 on 01 Dec 2021 at 14:14:04
    Re: Save form and load next record

    You could replace the grid you're coming from with a PCF that pops a modal form. That way, you never really leave the context of your grid. There are a lot of downsides though; you would need to build a grid that replaces enough of the OOB functionality, then you would need to replace all grids that need this capability with your PCF, then you would need your users to be OK with the fact that some grids behave one way and others behave differently... Not ideal, but possible.

  • skoofy5 Profile Picture
    480 on 01 Dec 2021 at 11:24:07
    Re: Save form and load next record

    I don't think that's possible. At least, there's no way that I'm aware that you can retrieve the table view you were on prior to loading the record.

     

    The best you could do is a custom retrieve that filters to the next record based on some static filter criteria and your current record acting as a 'previous'. That would only work if you sort criteria was based on something like a date.

     

    Alternatively, what about a ribbon button that acts on multiple records at the one time? We have a ribbon button that updates progress status of multiple selected records from the table view.

    skoofy5_0-1638357782128.png

     

  • eleung83 Profile Picture
    232 on 01 Dec 2021 at 03:47:35
    Re: Save form and load next record

    When you're within the context of the form where your custom ribbon button resides, that context has no knowledge of where it's come from (with exception to the save and close, but its D365 internally knowing what the previous record was)

     

    There's 2 options that come to mind that could get you part of the way but you would have to use an editable grid and you would still have issues if the user has sorted or filtered the grid results and if the results spanned multiple pages.

     

    1. On click of the record within the grid, register an event handler for the record select event, where you can then replace what happens when a user selects a record. From here you can then open up the form for the entity and pass custom parameters to the form which you can then read in custom JS on the form on in the custom ribbon button action. You could theoretically get all the record ids from the grid and pass them through to the form so you could theoretically work out which is the next record to open, or pass the id of view that the grid is using and execute that view via code to get the same results in code (but they both present more issues if you go down this route)

     

    2. An alternative to the save and next: Register the same record select event handler as (1), but instead of navigating away from the main form where the grid resides, you can popup the record in a modal popup instead, so the user hasn't navigated away from the main form, and could just click on the next record in their view of the grid results once they've saved the current record

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard
Loading started