Upload Attachment Not Associating to Document (requiring additional call)
See original GitHub issueWe are trying to use the code below to upload an attachment to a document. I believe the ASsignDocument may be an extra call. The fact that we are setting the Document / Entity Reference seems like it should be attaching it on upload. See the code sample below. The last line seems unnecessary but without it, the attachment goes into the unassigned attachment bucket.
var newAttachment = new LoanAttachment(fileInfo.Name.Replace(fileInfo.Extension, "")
, fileInfo.Name, AttachmentCreateReason.Upload);
newAttachment.Document = new EncompassRest.EntityReference(containerId, EncompassRest.EntityType.Document);
var attachmentID = await apis.Attachments.UploadAttachmentAsync(newAttachment,fileData);
await apis.Documents.AssignDocumentAttachmentsAsync(containerId, EncompassRest.AssignmentAction.Add,
new List<EncompassRest.EntityReference>() { new EncompassRest.EntityReference(attachmentID, EncompassRest.EntityType.Attachment) });
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Allow users external to organization to upload files ...
I have a file upload request in place for people out side our organization, it's open and anyone can upload but it do...
Read more >Need the ability for external users to upload files into MS ...
However external users cannot use the upload file feature in MS Forms. ... Another big advantage is that you'll get the files associated...
Read more >force metadata when uploading files
Hello, When I enforce values in a column in a library (in a team site), and then when uploading a file, I am...
Read more >Re: Adobe Sign Send with Attachments/Supporting Do...
I have tried text tags with prefill options and I have tried the 'add files' option when setting up for signature, but all...
Read more >How the heck do I attach a file to a record via a Site Guest ...
For example, you would need to first create the record, keep it accessible to the site guest user, allow the file upload to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That worked!
Could you try adding the following code before making your request?
If that works for you then we can add a strongly-typed
DocumentRefId
property toLoanAttachment
.