link to attached file from grid

Is there a way to have a field in a real grid (not a form) showing links to open\download attached files directly?

The attachment field is a “Document (File Name)”, single file (no multi upload) that is populated via a real form.

Afaik, yes, just apply the right filetype.

Thanks Albert,
I did find out that it was as simple as that.

But I’d like NOT to have the filename displayed in the grid, as it could be very long.

Any way to customize what’s shown in the grid field while retaining the link to the attached doc?

I guess that if you intercept the rows by an onrecord event you’ll be able to add a href yourself, ie as a custom field. If you need a php download you could create a small blank applications that replies the right header with data.

Adding the href is the easy part.

It’s the href content that is very complex.

These are HREFs for the first four records in a grid, as generated inside the SC field that will show the filename and link to the attached doc:


javascript:nm_mostra_doc('0', 'T2ZmZXJ0YSBFY29ub21pY2EgUHJvY2xlc2lzIFQxMTA0NDMzIEwxICgxKS5wZGY=', 'grid_quotes_out', '/scriptcase/app/pro_apps/grid_quotes_out/grid_quotes_out_doc.php')

javascript:nm_mostra_doc('1', 'T2ZmZXJ0YSBFY29ub21pY2EgUHJvY2xlc2lzIFQxMDQ5NzMyIEwyLnBkZg==', 'grid_quotes_out', '/scriptcase/app/pro_apps/grid_quotes_out/grid_quotes_out_doc.php')

javascript:nm_mostra_doc('2', 'T2ZmZXJ0YSBFY29ub21pY2EgUHJvY2xlc2lzIFQxMDI3OTE4IEwxLnBkZg==', 'grid_quotes_out', '/scriptcase/app/pro_apps/grid_quotes_out/grid_quotes_out_doc.php')

javascript:nm_mostra_doc('3', 'T2ZmZXJ0YSBFY29ub21pY2EgUHJvY2xlc2lzIFQxMTAzNzUwIEwxLnBkZg==', 'grid_quotes_out', '/scriptcase/app/pro_apps/grid_quotes_out/grid_quotes_out_doc.php')

The SC function seems to be:
nm_mostra_doc(’[row_number]’, ‘[some_sort_of_GUID?]’, ‘[app_name]’, ‘[server_path]/[app_name]/[app_name]_doc.php’)

It’s the [some_sort_of_GUID?] that I really don’t know how to calculate. Also, I guess that without having that field in the grid, the nm_mostra_doc won’t be created and included in the web page so it won’t be usable.

I guess that’s the easy\reliable thing to do is to let SC create the above field but hide it. Then I can have a custom field that I can use to show what I like and copy (via javascript) the href from the hidden field to the custom visible field.

I have a grid with a field, that links to a .pdf file. For the link i’am use simply the sc_link() macro in event OnRecord.

@RHS
how do you build the sc_link for files attached to database records (as “Document (File Name)”) ?