Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Pages - General Discussions
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:
  • Jose Gregorio Diaz Profile Picture
    67 on at
    Re: How to validate a record is created in multistep form

    It works perfectly, I appreciate the help. 🙂

  • Verified answer
    Inogic Profile Picture
    1,023 Super User 2025 Season 1 on at
    Re: How to validate a record is created in multistep form

    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/

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >