cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DanielFrank1
Frequent Visitor

Disable Submit Button, if field value are less then required

Hello together,

 

so we have a canvas app which is connected to our Dynamics365 System. Now we want to be able to edit Opportunites in the Canvas App. We have two fields called "Expected Revenue p.a." and "Est. Transactions p.a." both fields have a requirement in Dynamics365 to have a Value over 5000 (expected revenue) and over 150 Transactions. The problem in the canvas app is, that the canvas app, doesnt regonice those requirements and you can just safe the opportunity with less then the requirements. 

 

Now I tried to that in the canvas app. So for the fields I was able to create a error message, when the field Value is less then the requirement. I dont know if this was the best way, if you found a better way, i´m open for your input

 

DanielFrank1_0-1638219214229.png

 

Now I want to disable the Submit button if one or both of those fields doesnt have the requirements in it. If I do it for one field it is working. I just type in the Displaymode: If(Value(DataCardValue11.Text)<5000;DisplayMode.Disabled;Displaymode.Edit) 

 

but if I want both fields to be required, it just wont work. I tried it like this:

If(Value(DataCardValue11.Text)<5000 And Value(DataCardValue7.Text)<150;DisplayMode.Disabled;DisplayMode.Edit)

 

and like this

If((Value(DataCardValue7.Text)<150) And (Value(DataCardValue11.Text)<150);DisplayMode.Disabled;DisplayMode.Edit)

 

Can you tell me, why it just doesnt work? It only takes the first requirement, the second one is just ignored

 

DanielFrank1_2-1638219562986.png

 

Thank you very much

Best Regards

Daniel

 

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User
Dual Super User

Turn your logic around and you should be fine.  You want the submit button to be enabled only when both thresholds are met.

If(Value(DataCardValue11.Text)>5000 And Value(DataCardValue7.Text)>150;DisplayMode.Edit;DisplayMode.Disabled)

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

3 REPLIES 3
Pstork1
Dual Super User
Dual Super User

Turn your logic around and you should be fine.  You want the submit button to be enabled only when both thresholds are met.

If(Value(DataCardValue11.Text)>5000 And Value(DataCardValue7.Text)>150;DisplayMode.Edit;DisplayMode.Disabled)

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Wow that was easy.. thank you very much 🙂 

 

One more question. The Error Messages that are in the Form for every field. They pop up when a required field isnt filled out. Is it possible the have the same Error Message, when the Value isnt the requirement? Because I would like to have the error Message right under the field, where something is missing

 

DanielFrank1_0-1638256143159.png

Like here, when it is saying, that the type is missing

There is no simple way to change where the error messages display.  For that you would need to create a label for each field with the visible property set based on whether that field had an error or not.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,299)