How to tell if a file has been uploaded
I have a file upload component on a wizard and have a couple questions:
1. How can I tell if a file has been uploaded so that I can not enable the "Next Step" button until one has been uploaded?
I am saving to the attachments on the Record. I want them to be able to upload one or more files.
2. I would like to display the names of the files immediately after they have been uploaded to give them some feedback that it has succeeded. The file upload does not seem to trigger a re-query of the record and there does not appear to be an action framework.
Any ideas?
Thanks,
Tony
1. How can I tell if a file has been uploaded so that I can not enable the "Next Step" button until one has been uploaded?
I am saving to the attachments on the Record. I want them to be able to upload one or more files.
2. I would like to display the names of the files immediately after they have been uploaded to give them some feedback that it has succeeded. The file upload does not seem to trigger a re-query of the record and there does not appear to be an action framework.
Any ideas?
Thanks,
Tony
Tagged:
1
Categories
- 7.9K Questions
- 926 Ideas
- 220 Discussion Categories
- 178 General
- 9 Community Feedback
- 3 Community Info
- 18 Knowledge Base
Comments
Make a model on the Attachments sObject (with a condition linking the ParentId to the record you're attaching to. Make a table on that attachments model and place it just below your file upload component.
That should get you started.
You can then create an enable condition on your next step button for the number of rows in your attachments model.
Thanks for the idea.
I tried something similar but the Attachments Model did not automatically re-query when the file was uploaded and I don't see a way to re-trigger that query (file upload does not have an action framework).
Is it your sense that the Attachment model would somehow refresh?
Tony
I believe this the the behavior you're looking for?
Here's the XML:
Looks great in your version but I am having trouble getting this to work with a new object that I have just created. Basically I have a pop-up to create an Account and then immediately want to add attachments to it. When I click the upload button the file is successfully attached but my corresponding attachments model is not updated. Perhaps I am missing something in terms of how to properly connect the Attachments model to the Account model in the case of a new record.
I've included XML below.
Thanks for jumping in, and on a Saturday no less.
I am successfully saving the new object first. And I am successfully uploading the attachment. I just don't seem to be getting the NewAccountAttachment model to update when the file is uploaded.
See video below.
Thanks for the help. I added an action on the NewAccount model so that when it is saved it resets the Condition on the NewAccountAttachment model and then requeries it, and now it works.
I'll paste the XML below in case anyone else ever runs into this same problem.
The problem wasn't that the attachments model doesn't requery after the attachment is loaded, the problem was that the attachments model wasn't properly connected to the record, so it didn't know to requery when the file was uploaded. What Tony is doing is setting the condition to link the models when the account record is saved... which seems to make sense? Perhaps the query is not needed? before the upload?