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 / Portals - Edit button ...
Power Pages
Unanswered

Portals - Edit button above subgrid for a custom entity

(0) ShareShare
ReportReport
Posted on by 184

Hello

 

Can I know if I can create a button to perform edit of a record please? In my instance I will be having only record for this custom entity.

 

Capture.PNG

 

Thanks

Vik

Categories:
I have the same question (0)
  • - Matt Bayes - Profile Picture
    91 on at

    Hey Vik,

     

    We have have a similar requirement for some of our clients.

    In order to achieve what you are wanting, some Javascript code will need to be written in order to build a button that will essentially "click" the line-item-level button.

    The first step will be to write Javascript (JS) on load of your webpage to render a button above the grid. The easiest way to do so would be to select the table or section and find the parent element(s). From there you can "prepend" the button.

    Once the markup for your button is created, you can have it trigger an onclick JS function that will "click" the edit button for that single row. The easiest way to do this would be to iterate or retrieve the row(s) of the table, then find the actions column based on the class. Once retrieved, you should be able to drop into the children elements of that class and find the "edit" button. Be sure to select it via the class/id as there could very well be other buttons added and you wouldn't want to assume the "edit" is the only one.

    Once you find the button selector, you can add that to your JS onclick event and call the $(_editbutton).click() event, which will simulate a click of the button, thus allowing you to edit that particular record.

     

    It sounds a little confusing, but what we are doing is adding in a placeholder button that simulates a click of the edit button. It may be beneficial to "hide" the edit button on the item-level so the users have to use the placeholder button.

     

    If you need any more help or assistance please don't hesitate to reach out!

    Thanks!

     

    Matt Bayes

  • oliver.rodrigues Profile Picture
    9,482 Most Valuable Professional on at

    The method mentioned by @mbayes would open the modal edit form. 

    Might be easier if you want to open as a full page... going for similar approach, you can:

    • Preppend the button as mentioned
    • The button will contain a link to the Edit Web Page, here you need to read the subgrid data and get the record id
    • Then add the record id into the URL for the Web Page
  • adampfau Profile Picture
    Microsoft Employee on at

    By default only the view actions show up at the top.  The Item actions are what you showed in the screenshot.  

    AdamP_0-1612158567507.png

     

  • justinburch Profile Picture
    Microsoft Employee on at

    Hi @arjunmusuvathy,

    If there's any chance the record might not be there, or might change, I'd recommend hooking the suggested code to the Entity Grid's "loaded" and "refresh" triggers, so that your prepend logic knows when there is a record available to hook on. Otherwise, I'd have the button disabled by default and use the triggers to enable it, so that there aren't instances when users (or automated tests) can click the button and nothing happens.

     

    At a high level, it's:

    function addButton() {
     // remove old button, add new one.. or 'upsert'
    };
    $(".entity-grid.entitylist").on("loaded", addButton);
    $(".entity-grid.entitylist").on("refresh", addButton);

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Mohsin Ali Profile Picture

Mohsin Ali 33

#2
sannavajjala87 Profile Picture

sannavajjala87 28 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 22 Super User 2026 Season 2

Last 30 days Overall leaderboard