We currently have an attachment table with file_name and as domain control : File Upload.
Now we want to if someone clicks on that file name in the application. They will NOT be redirected to google chrome / internet explrorer to open that document.
Is there a way we can achieve that somehow?
Best answer by Mark JongelingView original
You can decide to use an expression column that takes the value of the File name field and presents it as Text rather than a File upload field. With a Layout procedure, you can make sure you see the Text in Navigation mode, whilst seeing the File upload field in Add/Edit mode.
Hope this helps!
I have a question on your follow-up. Using with the layout procedure. How can I change it to text? Because I`ve tried this multiple times with no succes
Do I just do like? :
Not quite, the Layout procedure can only affect the Visibility of fields and tell the GUI to make fields Mandatory.
Let's say you have the following in your table:
col_id int (primary key)
The column file_name has a domain with the File upload control, whilst file_name_text does not have the same domain but rather uses a generic domain that is simply a varchar(1000) and has no control).
File name text is an expression column that uses the following query to obtain its value:
Indeed, nothing more, nothing less😃
In your Layout procedure for the desired table, write the following:
This will ensure that when you are Adding or Editing a record, the File upload field is shown, whilst in Navigation mode the File name text field is shown instead. Note that this only functions in the Form. The grid cannot interpretate the _type parts of the Layout procedure.
This should do the trick, let me know 😄
This did the trick. But sadly not the expected result that I wanted.
Although this is in a form. The way we have It with our files is that we display it as a grid. Like this :
Is there a possible way to achieve that?
One way I can think of, not ideal but does the job, is having a circle reference on that table, that uses a Table variant in which the file_name_text column is shown in the grid. But that also requires the screen type to only show the Grid for the variant, have a Detail tab container with the same table, but then only showing the Form, that uses either its own variant or the original table.
So then you have
Grid - Table A, variant A - show file_name_text in grid (does show details - circle reference)
Form - Table A, (variant B) - show file_name (show no details)
Screen type having Grid and Detail tab container, Variant B using a Form only screen type
Hope it gives some inspiration 😄