Can you get a Configuration Console User Field Binary to retain the file name of the uploaded file? Right now it's assigning it to the user field name (ex. Document4).
Dr. Awesome and Andy have shown you one way of using the Attachment type, and for adding a user field to a delivered business class is the ideal way to go. It is a group field that has a member field that holds the BinaryDocument and one that holds the DocumentTitle.
BinaryDocument
DocumentTitle
The "magic" happens thanks to the special feature of the DocumentTitle primitive type, as outlined in the LPL Configuration Console guide on page 12 (as of the September 2022 version), speaking about neighboring fields whose primitive types are DocumentTitle and MimeType:
MimeType
[An] Alpha field with special characteristic: when in the context of a BinaryDocument, it is populated when the BinaryDocument is populated. When user selects a file on disk into a BinaryDocument field, we search for the closest DocumentTitle and MimeType and fill them out.
If you are creating your own user business class and you don't want to use the Attachment type for some reason, then you just need to have three fields, one each that are of [primitive] type BinaryDocument, DocumentTitle, and MimeType, the later two will get auto-populated when a user uploads the file via the form.
Attachment
Is your UserField of type "Attachment"?
So:XYZMyFileField is an Attachment
There is no 'Attachment' type. There's BinaryDocument and BinaryObject.
Okay, in Config Console there is a filed type "Context" which has the attachment type of field. I don't understand why there is also a BinaryDocument type in the 'Field' type.
Thank you.
Hi - I feel like I am missing something here. Same use case as David. I was using a binary object to attach a PDF to a form and then created an action to send it via email as attachment.
I repurposed the field on my user business class "FormX is an Attachment". On the form I am presented with the Title, Attachment, and File Type fields. When I upload the PDF attachment to the field, the Title and File type autopopulate.
However when I receive the email the attachment has lost it's file type.
LPL on Business Class
FormX is an Attachment
LPL On my action:
send email
to EmployeeEmail
subject "FormX Attached"
Attachments
attachment FormX
Figured it out. The issue for me was the action LPL.
attachments
attachment FormX.File
name is FormX.Title
mime type = FormX.MimeType