cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Elitezone
Post Prodigy
Post Prodigy

Error message depending on Form4 View/Edit

Hello,

 

Is it possible to set a button inactive if a Form is in a ViewMode?

I wanted to make button invisible with formula:

 

If((Form4.DisplayMode=DisplayMode.Edit) = true;false); Notify("Changes are possible only in Edit form.";NotificationType.Error);

 

but first - it doesn't work, second It looks bad (button placement).

So I thought that maybe If I make an error message in ViewMode it will be sufficient.

 

Thank you. 

1 ACCEPTED SOLUTION

Accepted Solutions

The semi colon ; before the Disabled should be a dot .

DisplayMode.Disabled

Not

DisplayMode;Disabled

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

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. 

View solution in original post

4 REPLIES 4
eka24
Super User III
Super User III

If the objective is to make the button inactive when form is view  then in the displaymode of the botton put;

 

If(Form4.Mode=FormMode.View, DisplayMode.Disabled,DisplayMode.Edit)

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

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.

@eka24 

Errors:

Invalid argument type, and also expected Boolean received text.

 

 

If(Form4.Mode=FormMode.View; DisplayMode;Disabled;DisplayMode.Edit)

 

Elitezone_0-1600691730334.png

 

This displaymode was Edit on default before I changed it. 

 

The semi colon ; before the Disabled should be a dot .

DisplayMode.Disabled

Not

DisplayMode;Disabled

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

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. 

View solution in original post

VijayTailor
Resident Rockstar
Resident Rockstar

As I went through all the Suggestions.

 

Please Find a new solution on top of the below solutions>

if you want to Change the button don't change the Mode of the Button Just change the color of the button.

another thing assigns the Form Mode value to Lable and OnSelect of Button use If Condition for DIsplay Notify function.

change the Button Color Based on Form Mode - Expression - If(Form1.Mode=Edit, Green, Gray)

Assign the Form Mode Value to Hidden Label - Like that - Form1.DisplayMode

On Button, Select Use this Expression - If(Label8.Text="view",
Notify("Form Not editable",NotificationType.Error),
SubmitForm(Form1));

VijayTailor_0-1600693572707.png

 


Hope this solution helps you to resolve your issue. 

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

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

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (109,503)