Can a reference be optional? Can an enum accept any value?

I'm making an asset management tool.  A list of Maintenance Logs have some tasks, status, completion date, etc.  Some maintenance logs are generated automatically, based on another list of recurring maintenance schedules.  Other Maintenance Logs can be added ad hoc as maintenance occurs.  When a maintenance log is generated based on a recurring schedule, I would like a reference to that schedule included in the Maintenance Log.  However, if an ad hoc log is created, there is no value for the schedule ref field.  So, sometimes the ref field would have a value and other times it would not.  

This would work fine for me.  However, when the ref field is blank, a yellow warning triangle appears beside the label field whenever the logs are displayed in a list.  There doesn't seem to be any way to indicate that a ref field is optional nor a way to suppress the yellow triangles.  Can the yellow icons be suppressed or ref fields be set as optional?

As a workaround, I tried turning the ref field into a enum field, using the appropriate list of schedule names as selectable values.  However, that generates an error when the value turns out not to be included in the list of configured values for the enum.   Can enums be configured to accept any value? 

It seems like the only workable workaround will be to populate a text field with the schedule record id.  Workable, but not ideal.  

 

0 2 59
2 REPLIES 2

TeeSee1_0-1673848054015.png

Unless the required option is selected, any field should be 'optional'.

The yellow warning sign is usually displayed when the value does not match any value in the referenced table's key column. Are you certain the ref column contains nothing where the sign is shown?

That’s good to know. Thanks.   Some time has passed now and I don't even remember how I resolved it, but making the display tightly bound to the input list values seems like a curious design choice to me.  In many other applications, I've used a text field with a controlled list of inputs and, for various reasons, also stored values that are not included in the list of input options.    It would be nice to have the option of hiding this yellow warning.  Anyways, thanks again for helping me understand what the yellow icon means.  Cheers!

Top Labels in this Space