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

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
Highlighted
Super User II
Super User II

Re: Need Cancel button on Entity Form in power apps portal

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
Highlighted
Super User II
Super User II

Re: Need Cancel button on Entity Form in power apps portal

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


 

Highlighted
Helper I
Helper I

Re: Need Cancel button on Entity Form in power apps portal

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.

 

Highlighted
Super User II
Super User II

Re: Need Cancel button on Entity Form in power apps portal

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

Highlighted
Super User II
Super User II

Re: Need Cancel button on Entity Form in power apps portal

@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


 

Highlighted
Helper I
Helper I

Re: Need Cancel button on Entity Form in power apps portal

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,

Highlighted
Super User II
Super User II

Re: Need Cancel button on Entity Form in power apps portal

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


 

Highlighted
Helper I
Helper I

Re: Need Cancel button on Entity Form in power apps portal

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,

 

 

Highlighted
Super User II
Super User II

Re: Need Cancel button on Entity Form in power apps portal

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!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Users online (5,818)