cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper II
Helper II

Need Cancel button on Entity Form in power apps portal

Hello,

 

I have a Create Entity Form for one of the entity, On that form, I can see the Submit button to insert the records into the entity, Along the line I also need the Cancel button to cancel the form, However, I have a * sign on the top right section of the form to cancel the form.

 

Please suggest any solution to this.

 

Regards,

 

1 ACCEPTED SOLUTION

Accepted Solutions

You can achieve that via JS/jQuery

 

You can add the below code into the Custom JavaScript section on your Entity Form

$(document).ready(function(){
    AddCloseButton();
});

function AddCloseButton(){
    var button ="<input type='button' class='btn btn-warning' value='Close' onclick='parent.$(\".form-close\").eq(0).click();'/>"
    $("#EntityFormControl_EntityFormView").next().append(button);
};


------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

View solution in original post

8 REPLIES 8
Super User II
Super User II

hi

 

can you add a snapshot with the issue and what you need?

is your entity form showing as a pop-up within an entity list?


------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

Hi @OliverRodrigues ,

Let's say I have a web page in the power apps portal, and I have one form component on that web page, as shown in the screenshot below,
Besides the Submit button in the form component, I need the 'Cancel' button to reload the same page.

 

praneshJ_1-1600330289416.png

 

Please add comments on this.

 

You can achieve that via JS/jQuery

 

You can add the below code into the Custom JavaScript section on your Entity Form

$(document).ready(function(){
    AddCloseButton();
});

function AddCloseButton(){
    var button ="<input type='button' class='btn btn-warning' value='Close' onclick='parent.$(\".form-close\").eq(0).click();'/>"
    $("#EntityFormControl_EntityFormView").next().append(button);
};


------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

View solution in original post

@praneshJ did that solution work ? if yes can you mark as answer so people can refer to it in the future?

thanks




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

Hi @OliverRodrigues ,

 

The button is getting displayed on the popup as expected, but on click of that button popup window is not getting closed using the given code in above solution.

praneshJ_0-1600936627647.png

 

Any alternatives to close the popup on click of this close button, would be really helpful.

 

Regards,

In my code I am finding the main close button "x" via class: form-close

inspect your element and see if you have the same class there, if it is a different one you can replace in the code




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

Hi @OliverRodrigues ,

In my code I am finding the main close button "x" via class: close,

and i have replaced it with the close in my code now, please check the below screen shot.code.PNG

but it still not getting closed.

 

when I checked replacing close with form-close that in the browser, its working fine then.

 

Please suggest any alternatives or let me know how can I replace the class for that "x"  button ?

 

I am really thankful for your quick replies.

 

Regards,

 

 

is it working for you with the .close class? 

whatever class works for you is fine, there is no need to change the x button




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Users online (7,157)