Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

Unable to validate condition if user uses next or previous button on card ribbon

(0) ShareShare
ReportReport
Posted on by 45

I used some validation on a card page inside an OnOpenPage trigger and it is it working fine until I start using previous and next button within ribbon on card page.

Any suggestions to make it work

  • Suggested answer
    YUN ZHU Profile Picture
    81,360 Super User 2025 Season 1 on at
    RE: Unable to validate condition if user uses next or previous button on card ribbon

    Hi, Is it possible to try to close the current page and open a new page?

    A simple example:

    https://yzhums.com/16756/

    Hope this will help.

    Thanks.

    ZHU

  • Lars Lohndorf-Larsen Profile Picture
    on at
    RE: Unable to validate condition if user uses next or previous button on card ribbon

    Hello,

    I think you are out of luck on this one. According to this:

    github.com/.../1664

    Quite: "We do not support dynamic changes to the page Editable property, except via CurrPage.Editable(FALSE) in OnOpenPage.".

    I will watch here in case someone else has some ideas. Maybe you can change Editable for groups or fields, but I could also not find any ways to do that. Sorry I dont have better advice.

  • Aditya raut Profile Picture
    45 on at
    RE: Unable to validate condition if user uses next or previous button on card ribbon

    pastedimage1639573326099v2.png

    So this is the condition and if it is correct then I need this editable property of page to false.

    But even if the condition validates page is still editable.

    However this condition works on "OnOpenPage" trigger but that previous and next button ruins functionality

  • Inge M. Bruvik Profile Picture
    1,021 Moderator on at
    RE: Unable to validate condition if user uses next or previous button on card ribbon

    Maybe you can share your code ?

  • Aditya raut Profile Picture
    45 on at
    RE: Unable to validate condition if user uses next or previous button on card ribbon

    Thanks NorthW , but I have already tried "OnAfterGetRecord" but it is not working correctly for my validation

    Basically I'm making Editable property to false for it but no luck

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,021 Moderator on at
    RE: Unable to validate condition if user uses next or previous button on card ribbon

    When you move between records the page is not opened again so your "OnOpenPage" trigger will not be executed as a result for that.

    You need to use the "OnAfterGetRecord" trigger to have something executed when you move between records in a page.

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!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,095 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,866 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans