- edited description
Make a field mandatory based on other field
I have a drop down field with values "Yes" and "No", now when I select "Yes" that should make one of the field mandatory how can I achieve that.
below is the screenshot of the screen that I am taking about
In the screenshot when ever I select the "Yes" for the field Development Commitment then the PMUWS ID should be mandatory ( which means I should not be able to execute the transition without entering a value for the PMUWS ID field when I select yes) and also when I select "No" even if I dont enter a value in the PMUWS ID field I should be able to execute the transition.
I wish we could show a error message when ever I select "Yes" and dont enter a value in the PMUWS ID field and try to execute the transition.
Comments (11)
-
reporter -
reporter - edited description
-
repo owner You should use "Boolean validator with math, date-time or text-string terms" with the following boolean expression:
%{aaaaa} = "Yes" IMPLIES %{bbbbb} != null
replacing aaaaa with field code of "Development Commitment", and bbbbb with field code of "PMUWS ID".
There is a parameter to enter a custom error message and translations for all the installed languages.
-
reporter I tried this and this validation is not working Fidel, when I select Yes and hit the transition button without entering a value in the ID field there is no warning message shown
below id the screen shot of the validator that I used
-
repo owner Which field types are "Development Commitment" and "PMUWS ID"?
Let's do some debugging. Please, insert temporarily "Copy a parsed text to a field" post-function with the following configuration:
- Target field: New comment
- Text to be parsed:
Development Commitment: "%{aaaaa}" PMUWS ID: "%{bbbbb}"
replacing aaaaa with field code of "Development Commitment", and bbbbb with field code of "PMUWS ID".
Now, when you execute the transition, a new comment will be automatically created with the actual values of the fields.
-
reporter Ya this is the output of the comments I did select all the combinations
the field Development Commitment is a single select field and PMUWS ID field is a text field
-
repo owner "Development Commitment" is not an ordinary Select List custom field. Can you please check the exact type of custom field? Maybe provided by a plugin.
-
reporter It is a select list field and blow is the screen shot of the same
The other text that appears in the comment is because I made some changes to the field to change the color and look of the field thats it nothing other than that
here is the ss of the same
-
repo owner Use this boolean expression instead the current one:
%{aaaaa} ~ "Yes" IMPLIES %{bbbbb} != null
-
reporter That worked Fidel, thanks for the quick response really happy that you responded real quick :+1:
-
reporter - changed status to closed
this issue is resolved hence closing the issue
- Log in to comment