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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Custom Modal in out of...
Power Pages
Suggested Answer

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

(1) ShareShare
ReportReport
Posted on by 26
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:
I have the same question (0)
  • Suggested answer
    Hammed Profile Picture
    26 on at
  • surya narayanan Profile Picture
    102 on at
    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();
                }
            });
        });

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 78 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 75

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard