0

I am trying to switch all required datacards to false with the click of a button.

In SharePoint they are NOT required.

but I cant seem to get this to work, any tips?

Q1_DataCard1.Required=false;
Q2_DataCard1.Required=false;
Q2a_DataCard1.Required=false;
Q2b_DataCard1.Required=false;
Q2c_DataCard1.Required=false;
Q2d_DataCard1.Required=false;
Q2e_DataCard1.Required=false;
Q2f_DataCard1.Required=false;
Q2g_DataCard1.Required=false;
Q3_DataCard1.Required=false;
Q4_DataCard1.Required=false;
Q5_DataCard1.Required=false;
Q6_DataCard1.Required=false;
Q7_DataCard1.Required=false;
Q8_DataCard1.Required=false;
Q9_DataCard1.Required=false;
SubmitForm(EditForm1_1);Refresh('Questionnaire');

1 Answer 1

1

Create one variable in onStart of App object or in onVisible of screen control like:

Set(isRequired, true);

You can set initial value to true or false as per your requirements.

Then use this variable to set Required property of all data cards. Set Required property directly to:

isRequired 

Then you can change it's value on button click. Set OnSelect property of button control to:

Set(isRequired, false);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.