Setting allow_references=true forcing Field Name Type to be Mandatory? Bug?

G_Ede
Tera Guru

Heya, wondering if anyone has come across this before?

If I set allow_references=true on a field with the type "Field Name", it seems to force that field to be mandatory on the Form:

find_real_file.png

Weirdly, in such a way that it looks like there is a value, even if one has not yet been selected (or in this case even available as the dependant field that contains the table name is not completed):

find_real_file.png

This is problematic for me as this field is hidden by UI Policy, but when it becomes mandatory it forces the field to appear on the form.

It's definitely the attribute, as I remove can remove it, and the field goes back to behaving!

Does anyone know if this is the intended behaviour? Or any ideas for a work-around?

Thanks,
Graeme

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

You could write a client script onLoad that does g_form.setMandatory('fieldname', false);

function onLoad() {
   g_form.setMandatory('field', false);
}

View solution in original post

3 REPLIES 3

Chuck Tomasi
Tera Patron

You could write a client script onLoad that does g_form.setMandatory('fieldname', false);

function onLoad() {
   g_form.setMandatory('field', false);
}

Thanks! That worked perfectly 🙂

Bryan Guerre1
Kilo Contributor

I actually just ran into this problem myself, and the 

g_form.setMandatory("FIELD_NAME", false);

Solution does not work as intended. However, if you add one more attribute property, 

allow_null=true

Then the Field Name field will no longer be mandatory.

The instance version I did this on was, Paris. I assume this works on other versions as well.