File extension validator

Hi,

We need to create two file attribute fields/fragments: one allows for all file types as per the object’s settings, the other needs a validator which should only allow for .jpg, .jpeg files. After selecting the file, I’m having a problem getting its value using fragment_presenter.get_value(). A call to cs.log shows nothing. I was wondering if the change implemented in v 2021.2 has caused this? The change is described in this post:

Limiting file type on File attribute type - Liberty Create - Build Advice - Netcall Community

If not, does anyone have an example of this ?

Thanks, Mark

Hi Mark, I will try to get a Developer to assist you with this! Regards - MP

1 Like

Hi Mark, is there any update on this ?
Regards, Mark

Hi Mark, I apologise for the delay but all our Devs have been very busy working on getting or 2023.1 platform version launched. I have asked again and someone is looking at it shortly. I will respond once they get back to me. Regards - MP

Morning Mark,

I’m unusure of the reason, but it appears, that as you say, get_value() fails to return the file name shown in the UI.
I have raised this with our core team and will let you know when I get an answer.

Many Thanks

Adam Mills

This issue has now been resolved and the patch is available in all versions back to 21.2.
The get_value() method will return a filename in this pre-saved context.
It is worth noting that in the saved context a file_id will be returned that will need to be resolved.

Let me know if you have any issues.

1 Like

Hi Adam,

I am having an issue with this. After validation and saving, the file value is not saved to the field (the file attribute on the object). The output in detective looks like this:

As you can see, no file is saved.

Does this have to do with resolving the file_id which you mention above ?

I can also see in detective that an integer (in this case 44907) is returned by cs.log in place of the filename.

Thanks in advance,

Mark

This was a bug: resolved by Netcall in following patches:

24.1 - 2024.1.254 2024.1-70
23.3 - 2023.3.666 2023.3-80
23.2 - 2023.2.844 2023.2-109
23.1 - 2023.1.1363 2023.1-190
22.3 - 2022.3.1557 2022.3-247