cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Disable / Enable buttons

AccessReport.jpg

 

I have a datacard that contains a on/off switch (yes/no field from my sharepoint list) and a textfield. I would like the Access Report button to be disabled until the on/off switch = On and the Electronic Signature field contains a value.

 

Once the button is enabled and pressed, it would send that data to the SharePoint list.

 

Also, is it possible to make another button available ONLY AFTER the Access Report button is pressed? I want users to access another page using another button.

8 REPLIES 8
JRaasumaa
Memorable Member
Memorable Member

Simply have a variable assigned to yes or no and then use it in the DisplayMode field of whatever needs disabling/enabling.

 

Set your page On Visible to make a variable false (or wherever convenient):

 

UpdateContext({ClickableYesNo: false})

 

Put the variable in the button being pressed to change to true:

 

 

UpdateContext({ClickableYesNo: true})

 

 

And then set your DisplayMode to:

 

If(ClickableYesNo = true, DisplayMode.Edit, DisplayMode.Disabled)

 

This will disable it until true is found in whatever variable name you pick.

 

Hope that leads you to the right answer!

 

 

Anonymous
Not applicable

Should I copy & paste the code into those advanced properties fields? Or should I use the actual names of those fields (instead of clickableyesno)?

 

Copying and pasting did disable the button, but when I update the yes/no field to YES, the button is still disabled.

Anonymous
Not applicable

Also, for the button, if OnSelect = "

UpdateContext({ClickableYesNo: true})", how can I get the button to submit the data to the sharepoint list? Nothing happens when I click on the button.


@Anonymous wrote:

Also, for the button, if OnSelect = "

UpdateContext({ClickableYesNo: true})", how can I get the button to submit the data to the sharepoint list? Nothing happens when I click on the button.


 

You can have a button or actionable item run more than one set of code by using a ; between code.

 

For example:

 

UpdateContext({ClickableYesNo: true}) ; UpdateContext({Clickable2YesNo: true})

That will make both variables listed true.

 

 


@Anonymous wrote:

Should I copy & paste the code into those advanced properties fields? Or should I use the actual names of those fields (instead of clickableyesno)?

 

Copying and pasting did disable the button, but when I update the yes/no field to YES, the button is still disabled.


 

ClickableYesNo is just a random example variable I wrote, you can make it anything you want.

 

 

Anonymous
Not applicable

UpdateContext({DataCardValue2: true});SubmitForm(Form1);Navigate(Screen2,ScreenTransition.Cover)

 

Thsi is my code for the button OnSelect. I need the button to submit the data to a sharepoint list as well as navigating to another screen in the app. However, the data is not being submitted to the list, but the button navigates to the next screen.

 

 

Error.jpg


@Anonymous wrote:

UpdateContext({DataCardValue2: true});SubmitForm(Form1);Navigate(Screen2,ScreenTransition.Cover)

 

Thsi is my code for the button OnSelect. I need the button to submit the data to a sharepoint list as well as navigating to another screen in the app. However, the data is not being submitted to the list, but the button navigates to the next screen.

 

 

Error.jpg


 

What is the yellow exclamation mark saying when you mouse over? That's going to contain the answer as to what's going wrong.

Anonymous
Not applicable

It says "Title:Field Required"

 

Title is the textbox in the screenshot. It is a required field. User click on the yes/no field, enter a value in the textbox, and then click the button to submit and navigate to the next screen. That's the goal.

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

Top Solution Authors
Top Kudoed Authors
Users online (44,629)