web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / How to validate a reco...
Power Pages
Answered

How to validate a record is created in multistep form with a subgrid

(0) ShareShare
ReportReport
Posted on by 67

Dear community experts,

 

How can I do to add a validation to a multistep form that does not allow the user to click "next" if at least one record is added? I am using a subgrid to add those records, below a picture.

 

josegdiazv_1-1692639366061.png

 

 

I really appreciate any help you can provide.

 

Jose G Diaz

 

Categories:
I have the same question (0)
  • Verified answer
    Inogic Profile Picture
    1,229 Moderator on at

    Hi @josegdiazv ,

     

    You can validate the multistep form’s step using Custom JavaScript,

     

    Please follow the steps given below,

     

    1. Navigate to the Multistep form,
    2. Look for the step you wish to validate, open the step,
    3. Navigate to Form Options Tab, scroll down for the Custom JavaScript,

     

    Inogic_0-1692707991580.jpeg

     

    Add the Below JavaScript Code,

     

    In the below code,

    • I have created a Duplicate button,
    • I have also hidden the Default Next button,
    • On a specific condition, it clicks the default Next Button,

     

    $(document).ready(() => {

        //Hiding the main button from the form

        $("#NextButton").css("display", "none");

        //Initializing the variables

        let recordCount,duplicateNextBtn;

       

        //Creating a duplicate button

        duplicateNextBtn = "<button type='button' class='btn btn-primary button next submit-btn' id='btnDuplicateNext'>Next</button>"

        $(duplicateNextBtn).insertAfter("#NextButton")

     

        $("#btnDuplicateNext").click(() => {

            //Checking the Records count

            recordCount = $(".entity-grid.subgrid").find("tbody").find("tr").length;

            if (recordCount == 0) {

                alert("Please Add atleast one record in the grid")

            } else { $("#NextButton").click() }

        })

    })

     

    Save and SYNC the Website,

    Thanks!

     

    Inogic Professional Services Division

    Power Platform and Microsoft Dynamics 365 CRM Development – All under one roof!

    Drop an email at crm@inogic.com

    Services:  http://www.inogic.com/services/

    Power Platform/Dynamics 365 CRM Tips and Tricks:  http://www.inogic.com/blog/

  • Jose Gregorio Diaz Profile Picture
    67 on at

    It works perfectly, I appreciate the help. 🙂

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Pages

#1
Hammed Profile Picture

Hammed 22

#2
Lucas001 Profile Picture

Lucas001 21 Super User 2026 Season 1

#3
DP_Prabh Profile Picture

DP_Prabh 19

Last 30 days Overall leaderboard