Combobox doesn't have mandatory property

Combobox doesn’t have mandatory property

I have a combobox with an enumtype. In properties window, mandatory does not exist… How can i make this field mandatory?

Hi,

Is this field from a table? If so, have you considered making this mandatory at table level?

Hi

Thnx for reply,

I want to make this field mandatory only on one form. So I can’t make it mandatory at table level.

I set mandatory property of the field on form datasoruce and it works. But there is no red line on the field when it’s empty.

On the form’s init (not the datasource), put something like this, but replace your datasource and field as such…I think that’ll give it the red line you’re looking for.

salesTable_ds.object(fieldnum(SalesTable, Payment)).mandatory(true);

it didn’t work :confused:

And i also have another question…

What if i hadn’t got a datasource on the form. how can i set mandatory the combobox with an enumtype ?

no answer?

Set the autodeclare property to “Yes” then via code, do [control].mandatory(true); where [control] is the name of your control.

when i write ServiceShipment**.** the isn’t mandatory property for the control.

Strange…I didn’t even notice comboboxes didn’t have that property available. It looks like if you want to do it from the form level, you’re going to have to get creative because I can’t figure out how to get the redline under it. I think you need to make it mandatory at the table level, or try the form datasource field property. Perhaps you can change the background color via code of the combobox by doing:

combobox.backgroundColor(222); //RGB int value

element.redraw();