Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Pages - General Discussions
Suggested answer

Custom Modal in out of box Edit button form in Power Page

(1) ShareShare
ReportReport
Posted on by 22
Hi team,

I have out of the box entity list view in Power Pages in the Multisteps form. I have added view and edit forms which show the buttons to enable to view or edit record from the Portal page but I wanted a scenario where when user click on edit button, it should show custom modal that I built instead of out of the box form. Is there anyway to achieve this or hide and introduce custom edit  button? Aany resource that will be helpful? I know you may likely mention to go with custom view list but this is Multisteps form. I will really appreciate.
Thanks
 
Categories:
  • surya narayanan Profile Picture
    24 on at
    Custom Modal in out of box Edit button form in Power Page
    Hi,
     
    Here is the steps to Implement a Custom Modal for Edit Button
    1. Hide the Default Edit Button

      • Use CSS or JavaScript to hide the out-of-the-box edit button in the entity list.

      • css

        .entitylist .edit-link {
            display: none;
        }
        
    2. Add a Custom Edit Button

      • Use JavaScript/jQuery to dynamically insert a custom edit button into the entity list.

      • javascript
        $(document).ready(function () {
            $(".entitylist.entity-grid").on("loaded", function () {
                $(".edit-link").each(function () {
                    $(this).replaceWith('<button class="custom-edit-btn">Edit</button>');
                });
            });
        });
        
    3. Trigger the Custom Modal on Click

      • When the user clicks the custom edit button, open your custom modal instead of the default form.

      • javascript

        $(document).on("click", ".custom-edit-btn", function () {
            $("#customEditModal").modal("show");
        });
        
    4. Load the Record Data into the Modal

      • Fetch the record ID and populate the modal fields dynamically using Dataverse Web API or JavaScript.

      • javascript

        function loadRecordData(recordId) {
            $.ajax({
                url: `/api/data/v9.1/entities(${recordId})`,
                type: "GET",
                success: function (data) {
                    $("#customField").val(data.customFieldValue);
                }
            });
        }
        
    5. Save Changes from the Modal

      • When the user submits the modal form, update the record using Power Automate or Dataverse API.

      • javascript

        $("#saveChangesBtn").click(function () {
            var updatedData = { customField: $("#customField").val() };
            $.ajax({
                url: `/api/data/v9.1/entities(${recordId})`,
                type: "PATCH",
                data: JSON.stringify(updatedData),
                success: function () {
                    alert("Record updated successfully!");
                    location.reload();
                }
            });
        });
  • Suggested answer
    Hammed Profile Picture
    22 on at
    Custom Modal in out of box Edit button form in Power 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

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 > Power Pages

#1
Fubar Profile Picture

Fubar 69 Super User 2025 Season 1

#2
oliver.rodrigues Profile Picture

oliver.rodrigues 49 Most Valuable Professional

#3
Jon Unzueta Profile Picture

Jon Unzueta 43