How do I validate attachment name on record producer before submission?
I have a record producer that creates a record on a custom table.
I need users to be able to add attachments but the attachment name needs to be written in a specific way depending on what they select on the form.
Example format: variable1_variable2.jpg
I can find lots of guides on how to make attachments mandatory but how do I validate an attachments name before submission? If the attachment name isn't in the right format need to remove it from the page also.
Posted Mar 20, 2023, 9:48 PM UTC
As previous comment said, you need to set up a script (probably onSubmit ajax) to query the sys_attachment table and check file name. Table name and ID to query on actually depends on the version of sc_cat_item widget you’re using. Run some tests to check those, and from there you should be fine as long as you understand how to get the table sys_id of the record before creation