Optional custom fields

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
Rob
Posts: 20
Joined: 25 Sep 2017, 09:59

Optional custom fields

Post by Rob »

Sorry for the newbie question, but I could not find anything in these forums.

I have a custom field that I want on all displays, views and reports but I do not want it to be a required field. I've tried several things in Manage Custom Fields but nothing works and the entry/update screen continues to make it required.

What is the secret (or not-so-secret) sauce?
atrol
Site Admin
Posts: 8375
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Optional custom fields

Post by atrol »

I am not able to reproduce the issue using the given information.
Which version of MantisBT do you use?
Adding a screen shot of the custom field definition might help.
Please use Search before posting and read the Manual
Rob
Posts: 20
Joined: 25 Sep 2017, 09:59

Re: Optional custom fields

Post by Rob »

Here is a screen shot of the definition and the requirement to put in a value (as a blank will generate an error that there is nothing in it):

https://www.screencast.com/t/tubQtCMQlkd

I did try unchecking a bunch of the stuff and nothing worked.

Thanks for trying to help and maybe you know the answer!
Rob
Posts: 20
Joined: 25 Sep 2017, 09:59

Re: Optional custom fields

Post by Rob »

I also tried 0 min length and when that didn't work I went back to 2 min length. Ideally I want to have no value or "Yes". This issue forces me to add "No".
atrol
Site Admin
Posts: 8375
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Optional custom fields

Post by atrol »

Rob wrote:I do not want it to be a required field.
But you enabled check box "Required On Report". Uncheck it and reset also the Min. / Max. Lengths to 0
Please use Search before posting and read the Manual
Rob
Posts: 20
Joined: 25 Sep 2017, 09:59

Re: Optional custom fields

Post by Rob »

Newbie learning. I thought Report meant listing. Your suggestion worked perfectly.

Since I don't need a "No" (blank is actually better in our use case), I changed it to a string. Is there any magic to just allowing either a blank or "Yes"? I tried a few things like Possible Values as " |Yes" but it allowed "xxx". I was able to have blank or "Yes" as a list and maybe that is the better way to do it? If it is, how do I get blank as the default? Adding a space in Default Value had no effect.
atrol
Site Admin
Posts: 8375
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Optional custom fields

Post by atrol »

Code: Select all

|YES
for the list should work, but why don't you use a checkbox?
Please use Search before posting and read the Manual
Rob
Posts: 20
Joined: 25 Sep 2017, 09:59

Re: Optional custom fields

Post by Rob »

Any empty checkbox would not make sense to a person who doesn't know.

See attached. I tried using the List with both a space (" |Yes") and a null ("|Yes"), but I can't get the default of space/null to work in both cases. I can live with forcing to click space/null, but it's not ideal. Any suggestions? Is this a bug?
2017-09-26_8-25-27.png
2017-09-26_8-25-27.png (15.47 KiB) Viewed 8147 times
Rob
Posts: 20
Joined: 25 Sep 2017, 09:59

Re: Optional custom fields

Post by Rob »

The screen shot is showing space is the default but when I add the issue it that is not happening (some kind of screen shot quirk). However, I just added an issue and did not touch the list and it created a blank so perhaps it is working after all.
Rob
Posts: 20
Joined: 25 Sep 2017, 09:59

Re: Optional custom fields

Post by Rob »

Here is a better screen shot. It is not highlighting the blank, but it is creating a blank when nothing selected and since it is not a required field I think that's why it's working. The blank has to be there in case we want to change a Yes to a blank.
2017-09-26_8-35-51.png
2017-09-26_8-35-51.png (5.56 KiB) Viewed 8146 times
Post Reply