The CreatorCon Call for Content is officially open! Get started here.

file attachment field type; make it mandatory

hermanwinkel
Giga Contributor

Hi,

In london release the field type "File attachment" is introduced. I have an issue with making it mandatory.

When u make it mandatory, through ui policy or dictionary, and you click the "Click to add.." link, the UI policy kick in and says that the file attachment field is mandatory. In other words, I am not able to add an attachment to the field.

I have tried an on submit client script. But a g_form.getValue('file_attachment_field') doesnt return a value (??)

nb; when you click "click to add" an new window opens over the form. Thats why the ui policy kick in.

 

Any one have an solution for this?

9 REPLIES 9

Andrew Barnes -
ServiceNow Employee
ServiceNow Employee

Greetings Hermanwinkel, 

 That is sad news to me. I have verified what you said. I was excited to be able to use that to set at least one file attachment mandatory with simple UI Policies - but those dreams are now gone.

-Andrew Barnes
Join me at Developer Blog

Thank you for your confirmation! If you come across a solution, I will be happy to hear it from you!

poyntzj
Kilo Sage

3 bugs with this that we have found so far.

marking mandatory and then clicking to add.  It is because it is loading a new page and not a glideModal.  I have raised a feature request for this or to have an attribute that can switch

Also, we have noticed that if you have an attachment and then remove the attachment, the sys_id remains in the XML / field so you cannot do an onSubmit check to see if an attachment was added as there is a value.  The engineer said this is "working as designed".  Another feature request

and finally, if you mark the field mandatory and then mark it non mandatory, then mark it mandatory again (so by default it is mandatory then a ui pollicy hides the field and makes it non mandatory, then the policy is triggered again to show it and make it mandatory), it will be mandatory, but the field marker will not be there

 

To me it seems it was released way too early without any real testing

A colleague found a new bug today.  The field cannot be made Read Only