The classic UI for attachments causes the record to be saved immediately. I think you'd need to use the self-service style (Self Service->Service Requests->Create Service Requests) if you wanted to force an attachment before the SR could be created. You might be able to just use the table option inside of the classic SR application, I'm not honestly sure. But I did confirm that allows you to upload before the record is saved.
Normally if you want to require an entry in a child object before a record could be created you'd write an automation script on the launch point of Object Save with the Add option selected for your main object (SR in this case). Because trying to add an attachment using the standard control causes the record to be saved, this would make it impossible for the user to provide the attachment. By switching to the table control you should be able to require it.
From there, the script you need (in jython) would be something like below. The message (emx/doclinkRequired) would have to be defined in Database Configuration to render a proper error message to the user.
doclinkFound=False
doclinkSet=mbo.getMboSet("DOCLINKS")
doclinkMbo=doclinkSet.moveFirst()
while doclinkMbo:
if doclinkMbo.getString("OWNERTABLE")=="SR" and doclinkMbo.getDouble("OWNERID")==mbo.getDouble("TICKETUID"):
doclinkFound=True
break
doclinkMbo=doclinkSet.moveNext()
if not doclinkFound:
service.error("emx","doclinkRequired")
------------------------------
Steven Shull
------------------------------
Original Message:
Sent: Wed August 25, 2021 08:00 AM
From: Blaz Rakar
Subject: Attachment required in application
Hello,
Any idea how could I make that attachment is required in application where main object is SR --> Service Requests.
So user must always add picture/attachment then service request could be saved.
------------------------------
Blaz Rakar
------------------------------
#AssetandFacilitiesManagement
#Maximo