I'm trying to make my documents preview script more dynamic so I'm don't have to hard-code specific field names into the script. The script i have works just fine as is I just want to make one script that can handle all of my document previews.
So let's day I have an Invoices table and a Documents table with a field called "document".
The relationship looks like this: INVOICES -->>DOCUMENTS.
I create a Documents portal on my Invoices layout with a popover with the field "invoices_DOCUMENTS::document" in the popover and I give that field an object name of "invoices_DOCUMENT" The clicks the pop-over and then clicks the Preview button to open the document full size in their image/pdf viewer.
I'm trying to get the script to go to the object (which it does) and get the active field name so I can extract the file extension (pdf, jpg, etc) but I get nothing from Get(ActiveFieldName) inside the portal.. outside.. no problem.. but inside I just get a "?" in the Data Viewer. I even tried to concatenate the field name by using a variable ($field = Get(ActiveLayoutObjectName) & "::Document") and use that but that didn't work either.
So my question is.. what might be the best way to grab the active field name from a portal popover