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

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
OliverRodrigues
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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Users online (71,751)