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

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

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.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (1,227)