Solved

Downloading a file from a Generic Inquiry side menu

  • 2 April 2024
  • 4 replies
  • 75 views

I have a generic inquiry for displaying a side panel on an ‘Export Shipments’ page. This side panel lists all the Files on the page (this page has the option to create a document and attach it to the page, populating the default ‘Files’ popup).

 

I would like to update this side panel so when a user clicks the file name it will download the file instead of navigating to the ‘File Maintenance’ page.

 

I noticed the File Maintenance page has the ‘External Link’ field that is a part of the ‘UploadFileWithIDSelector’ -


I was originally using the ‘UploadFile’ data class for displaying the Name, CreatedDate, and a few other properties belonging to ‘UploadFile’ on the side panel but this data class doesn’t have access to the ‘External Link’ field so I updated the generic inquiry to use the ‘UploadFileWithIDSelector’ data class and attempted to add the ‘External Link’ field in the Results Grid - 
 




With this setup the page only displays the Name and CreatedDate with the External Link value being empty (also tried the Source URI and that is empty as well) - 

 


Some extra information that may be useful, I had to add a view records in the ‘Relations’ section to make sure the correct files are being retrieved for this particular ‘Export Shipment’ record as well as linking the NoteDoc table with the UploadFileWithIDSelector table based on the fileID - 

 

I’ve attached the exported generic inquiry as well. I feel like there is some other connection between tables that needs to be added (probably in the ‘Relations’ section) to allow the External Link to appear on the side panel so the user can click that link to download the file. Any help/suggestions are more than welcome!

icon

Best answer by mbarrett 3 April 2024, 02:38

View original

4 replies

Userlevel 3
Badge

@rcambier

I was able to get your inquiry into my local demo instance and was able to successfully get my uploaded files to be directly downloaded when clicking on the hyperlink on each record from the Results. Below are the steps you need to take in order to replicate this.

  1. First identify what your file download URL is for your Acumatica instance:
    1. This can be done by navigating to any file on the File Maintenace screen and selecting the “GET LATEST VERSION” button.
    2. This will prompt the selected file to be downloaded to your local system through your browser. Then navigate to the Downloads page of your browser and copy the File path that was used to download the file.

    3. Paste this information in some text editor program such as notepad and modify the URL by removing the “fileID=” and “revision=” information and replace each value with this exact text:

  2. Now back in the Acumatica Generic Inquiry screen go to the Navigation tab and paste the modified URL into the Navigation Targets Link field and select New Tab for the Window Mode.

    1. Once pasted you can move over to the Navigation Parameters section to the right and fill out the 2 Parameters we created in the URL to inject the value from the data fields.

      • Field = ((FileID))   Parameter = UploadFileRevision.FileID

      • Field = ((FileRevID))   Parameter = UploadFileRevision.FileRevisionID

 

  1. Now Save the Inquiry and apply this new navigation parameter to the data field you want the hyperlink on from the Results Grid Tab of the Generic Inquiry.

    1. Uncheck the Default Navigation check box and then select the URL in the Navigate To Column.

 

After all of these steps it should do exactly what you described in your original post open up your inquiry and test it out. Let me know if you run into any issues and Good Luck!
 

Thanks so much for the quick reply! Adding that modified URL as a navigation target is working and downloading the file as expected when clicking the ‘Name’ data field (after adding the nav target in the ‘Navigate To’ field for this ‘Name’ field) - great solution!

 

Do you know if it is possible to get the ‘base’ URL for the current acumatica instance? I will eventually be pushing this update to a dev environment where the URL is going to have the format of ‘acumaticadev.companyname.com/AcumaticaERP/Frames/etc….’.

 

Similarly when this gets to the live site the URL will be slightly different. If I can get access to the base URL and add this as another param such as ((BaseUrl)) to utilize in the navigation parameters so the final string is something like :

 

((BaseUrl))/GetFile.ashx?fileID=((FileID))&revision=((FileRevID))&fdwnld=1

 

Then I believe this solution would work in any environment and not just for my local. Going to look around myself and see if that base URL can be retrieved - thank you again for the help and any other help, much appreciated!

I was able to get it working by just removing the first part of the URL and just leaving - 

 

~/AcumaticaERP/Frames/GetFile.ashx?fileID=((FileID))&revision=((FileRevID))&fdwnld=1

 

This is still downloading the file as expected, going to test in our dev environment to be sure but I believe this solution will work!

Userlevel 3
Badge

@rcambier 

Glad I could help and that you found the answer for the Instance specific URL!

If you believe my solution was enough to assist with your initial request, I would appreciate it if you could mark it as the correct answer to your post. This will help others find the solution in the future who may come across the same issue.

 

Thank you,

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved