429
Views
12
Comments
mandatory fields not working
Service Studio Version
11.53.24 (Build 61544)


Hello, Can someone help me please about my mandatory fields not working. My save button is inside a form with mandatory fields but when I click the button, it still proceeds saving data even I have not put anything in the mandatory fields.



Button Property:


Input field set to mandatory

UserImage.jpg
vikas sharma
Champion

Hi,

Have you marked those fields as mandatory at field level means for each widget you need to mention that its mandatory or not. Because in the UI am not able to see the asterik(*) mark which generally appear when we make any field mandatory.

regards

UserImage.jpg
Rhyz Dela Cruz

Yes, I set mandatory as true in the required input fields like the title. Please see photo below

2022-06-06 09-58-43
Gourav shukla

Hello  Rhyz Dela Cruz,

                                  Make sure your attribute property Is Mandatory field is yes and also check your input field mandatory field is true also check save button Built-in Validations is yes . I have also send my OML file maybe it will help you.

Thanks

OSMDb.oml
UserImage.jpg
Rhyz Dela Cruz

My Buttons Properties are different.

2022-06-06 09-58-43
Gourav shukla

ok, you use Traditional web app follow this step for 

Validation in Traditional Web

  1. For each validation:
    1. Add the logic to validate the input value.
    2. If the validation fails, assign the input's runtime properties as follows:
      • Input.Valid = False
      • Input.ValidationMessage = "<your error message>"
  2. Check the value of Form.Valid after all input validations. If an inputs isn't valid, the form is also not valid:
    1. Add an If element with the following condition: Form.Valid
    2. If True, continue the action flow.
    3. If False, end the action flow. The form displays validation messages next to all inputs that aren't valid.

Form validation in Traditional

The Valid property of the form is False when:

  • Built-in validation for any field fails
  • You assign False to the Valid property of any field of the form
2022-06-06 09-58-43
Gourav shukla

It's a core file

Thanks

OSMDb_Core.oml
UserImage.jpg
Rhyz Dela Cruz

Yes it is a core file. Is there anything I need to set on the core file?

2022-06-06 09-58-43
Gourav shukla

Yes, make sure your attribute property Is Mandatory field is yes 

UserImage.jpg
Sourabh Chaturvedi

Hello,


Please make sure your input field is Mandatory is true after that when you submit the form it will check input field is filled or not .


Thanks 

2022-07-03 17-24-08
Sourabh sharma

Hello dear 

At the top of all, there is one property in all buttons which is  Built-in Validations which you have to make Yes , then only your validation will be applicable for the form Built-in Validations..

hope now it will work for you

2021-09-06 15-09-53
Dorine Boudry
 
MVP

Hi @Rhyz Dela Cruz ,

your setup of the input widgets looks allright.

you have to realise that you still have to make your Save logic in such a way that it takes into consideration the result of these validations.

You do that by adding an If at some point after validations (or if you only use built-in validations, at the top of your Save logic) and this If checks of everything is valid.  This can be done by looking at the Form.Valid property.

Only if Form.Valid is true, should your Save logic go ahead with it's normal processing.

Maybe revisit this training video, this is discussed from 5:30 onwards.

Dorine

@Gourav shukla : this has nothing to do with the mandatory property of the attribute, built in validations are only related to the input widgets property.

@Rhyz Dela Cruz : a lot of the answer you are getting here are about Reactive.  Although it is clear from your screenprints that you are working on a traditional app, please also tag it as Traditional when you ask the question.

2022-07-03 17-24-08
Sourabh sharma

yes Dorine Boudry you are correct.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.