Field documents(filename) should show the documents after comeback to the record

I use the field documents(fllename) to upload documents and fotos.
Works fine.
But after come back next time to the record in the form the uploaded (and saved) files donot show up.
Only after pushing “save” (= update) again the fiels show on the screen.
Ok I can build in with a javascript an extra save when load the form, but it is not nice because of flikkering (loading) the form twice.
Could be that this is by design, but I like to have a solution for this.

Regards Bert

I add a master detail form as grid with document in, so i can view documents associated with record.

Then i use Javascript to remove the checkboxes and file from the upload field.

Javascript:
Add code to javascript section under object: “Form” and under the Event: “onload”

document.getElementById("id_sc_loaded_documents").remove();

The code above will remove all checkboxes, the delete option, and filename/icon.

Use a grid to manage documents better! :smiley:

I have also taken to creating a separate form for file uploads, because having to press the upload button and then to press save is too much for most users, or they forget to press save or upload either way lol.

  • So i have a button on the form i want to upload files to.

  • That button takes me to a separate form to upload a file

  • User chooses file presses save, there is only one button needed on a upload form (no multi-upload from a direct form, but can be done using multi-record form). File is uploaded and associated to the record.

  • The upload form closes, and the original form refreshes

  • The file appears in the document grid i added to master detail.

It just looks neater! :smiley:

Example of how i use file upload. Then just use a grid to display uploads associated with record. :smiley:

fileupload.png

Somehow double posted, sorry.

Hi Mikelaw,

Thanks for your extended answer. Brings me to the point that the “upload” from SC is ment for uploading and that I have indeed to create a grid.
But the strange thing is that when I push the update button of the form in which I uploaded the document I see the uploaded files below with the option to delete.
In principle that would be enough for me. It is also possible from there to double click and open the document with the application in which it is made.
Ok I could give the user the instruction to push update to see the uploaded files, but its not nice.
In both cases I have to push a button …and that one step to much.
Thanks again and I think it over. I will let you know my final solution.

This all brings me again (besides of this issue) to the point that when sc makes as refresh option for a form (as with a grid) it will solve many things. There is a reload in the selectfields. So make this explicit in a macro. This is my wish for 2015. Have a good christmas time and a happy new year.

I found out that when the document is saved on the server (instead of on my localdrive) than it working fine…
Bert

[QUOTE=mikelaw;30504]I add a master detail form as grid with document in, so i can view documents associated with record.

Then i use Javascript to remove the checkboxes and file from the upload field.

Javascript:
Add code to javascript section under object: “Form” and under the Event: “onload”

document.getElementById("id_sc_loaded_documents").remove();

The code above will remove all checkboxes, the delete option, and filename/icon.

Use a grid to manage documents better! :smiley:

I have also taken to creating a separate form for file uploads, because having to press the upload button and then to press save is too much for most users, or they forget to press save or upload either way lol.

  • So i have a button on the form i want to upload files to.

  • That button takes me to a separate form to upload a file

  • User chooses file presses save, there is only one button needed on a upload form (no multi-upload from a direct form, but can be done using multi-record form). File is uploaded and associated to the record.

  • The upload form closes, and the original form refreshes

  • The file appears in the document grid i added to master detail.

It just looks neater! :D[/QUOTE]

I tried this and get the error in the console:

TypeError: document.getElementById(…) is null

document.getElementById(“id_sc_loaded_documents”).remove();

A search within source of the generated html shows “id_sc_loaded_documents” does not exist on the page.

What could I be doing wrong?

[QUOTE=scriptcaser;30801]I tried this and get the error in the console:

TypeError: document.getElementById(…) is null

document.getElementById(“id_sc_loaded_documents”).remove();

A search within source of the generated html shows “id_sc_loaded_documents” does not exist on the page.

What could I be doing wrong?[/QUOTE]

Where are you using this code?

This is how i use it in scriptcase:

Also, it will only exists if you have a multi-upload field with the same ID. It may be different for your app, but multi-upload fields have always used “id_sc_loaded_documents” for me.

java1.png

java2.png

java3.png

java1.png

java2.png