cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ssimbox97
Regular Visitor

Custom buttons on model driven command bar go in fatal error

Hello everyone. 

In my model driven app i need to add a custom button on Main Form command bar but everytime I press on it the site show me this pop-up

errorssss.png

And the log has not been helpful 

I receive this error on each added button, on any form of any table listed in my model driven.

The button formula is just a super basic notify func

Notify("hello world")

I found some errors like this because of adblock but it's not my solution.

1 ACCEPTED SOLUTION

Accepted Solutions
ssimbox97
Regular Visitor

Ok people I found a solution and here there I write what I found. 

I know it's a preview feature, but this is I what I can do for you and us!

 

As first: I tested my model driven app using different browsers and possibly, many computer. I work mainly on Edge (Chromium obv) and it returned me Script Error. Using Chrome no problem. On MacOS Safari good job.

Secondly: disable your adblock. I can't understand why but this works really well, there is some stuff underground.

 

Then, notify do its job as in canvas app.

View solution in original post

6 REPLIES 6
rampprakash
Community Champion
Community Champion

Hello @ssimbox97,

 

You cannot use Notify in Model driven App try using alert("hello world").

 

Please mark as Answer if it is helpful and provide Kudos


Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
Blog : https://microsoftcrmtechie.blogspot.com

Arcadi
Helper I
Helper I

Custom buttons don't work well, it's been extremely difficult for me too. Notify works though. 

What helped me is to make sure all your powerFX actions end with ";", this seems to avoid some conflicts. Also republish your solution, wait 2-3 minutes and ctrl+f5 your browser. 

EricRegnier
Super User
Super User

Hi @ssimbox97,

PowerFx is not fully supported yet in model-driven apps. The supported method to send alerts so that it works on tablets, mobile devices and/or web is with Xrm.Navigation.openAlertDialog. Alternatively, you can have a confirm dialog (openConfirmDialog) or error dialog (openErrorDialog).
More info: https://docs.microsoft.com/powerapps/developer/model-driven-apps/clientapi/reference/xrm-navigation/...  

Note that @rampprakash solution is not supported and sohuld use the client API as per above... 🙂

Hope this helps!

rampprakash
Community Champion
Community Champion

Hello @EricRegnier,

 

alert will show popup and its a supported way too, as @ssimbox97 expecting to show only notify i just provided that option. 

 

But Agree Xrm.Navigation.openAlertDialog will show Alert Box 🙂

 

Please mark as Answer if it is helpful and provide Kudos


Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
Blog : https://microsoftcrmtechie.blogspot.com

@rampprakash It’s not because it works that it is supported. To show any kind of notifications, the supported method is to use the client APIs.

ssimbox97
Regular Visitor

Ok people I found a solution and here there I write what I found. 

I know it's a preview feature, but this is I what I can do for you and us!

 

As first: I tested my model driven app using different browsers and possibly, many computer. I work mainly on Edge (Chromium obv) and it returned me Script Error. Using Chrome no problem. On MacOS Safari good job.

Secondly: disable your adblock. I can't understand why but this works really well, there is some stuff underground.

 

Then, notify do its job as in canvas app.

View solution in original post

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Users online (2,356)