FM - Advice about Accessing and Tracking Related Documents

My boss just asked the following question:  "Filemaker as a conduit to proper storage…. i.e., if I drag a pdf doc to a particular spot on Property info record… could the pdf doc be filed according to scripting conventions?  Would be way too cool if we could."

We scan documents that have to do with our various tenants often.  I have created a folder icon with a variable path so it opens the right folder for each tenant.  However, would there be a way of showing a list of the name of each file in FM, and/or showing that doc in a portal?  Thanks.
Who is Participating?
challengedayConnect With a Mentor Commented:
Yes, you can use the Container field to store documents OR reference to documents.

If you store the document it actually stores it inside FileMaker and the FM filesize increases.
If you store a reference then it acts as a shortcut to the file, so the file still resides in the file system.

What I find weird about Container fields is that they act differently depending on what you have stored (file or reference).

For example, clicking on a field with a stored reference automatically opens up the file (what you would expect), clicking on it with a stored file doesn't. In order to get the file to open you have to export it out (by right clicking and choosing export). So you get into scripting stuff to make things easier for the user.

My guess is that you want to store file references, in which case it means making sure that when someone inserts a file that the "Store only a reference to the file" checkbox is checked.

Unfortunately there's no way to specify that the checkbox be checked by default so you have to create a script. Otherwise people have to remember to check the checkbox.

A cool thing about file references is that the filename and the path are available to you through calculations:

I have two calculations:
FileName_Full_ct which is

FileName_ct which is
Substitute(Left (FileName_Full_ct ; (Position ( FileName_Full_ct ; "filewin"; 0; 1)-2) ); "file:"; "")

This seems like a good topic to write a blog post about. hmmm.....


To display a list of the contents of the folder, use a web viewer which runs a simple PHP script showing the contents of the folder.  Each item in the list can be a link which dowloads/ displays the doc (presumably a PDF?).  

TomDWallace (an EE expert) has provided detailed instructions on how to do this in answer to another question (I think the question asker was you actually, I may be wrong...).  I haven't got time to search for the question to provide a link here, but I'm sure if you run a few searches, you'll find it.

Good luck
rvfowler2Author Commented:
ChallengeDay, IF your solution could show the list of folders dynmaically, then it would be best, since is is self-contained within FM.  It would be nice if all someone had to do was save a file to a folder and it auto-showed in the container field or some list.  I may also want to have 2-4 tabs that show the 2-4 most common types of tenant files so users don't even have to open an attachment.  Playing around with this.

Tocacar, No, I've never asked this question before, and did not find TomDWallace's original answer.  However, I did find a similar question to mine where someone refered to him and then he jumped in with an abbreviated answer.  Clicked on him, but he doesn't have a contact link so I could get more detail.  However, with what I have, I'll put my head together with our website guy who knows PHP and see what we can do.
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

challengedayConnect With a Mentor Commented:
Sure, you could have a Document table, with a foreign key to tenants (or properties, or however you want to structure), so that for each tennant you could show a list of related documents in a portal. In the document have a field that calculates the filepath, with GetAsText ( FileContainer ). Then the portal shows all of the documents and their filepaths. Then if someone clicks on the icon of the file it opens it right up. (Files have to be stored as references for this scheme to work.)

If there is no file then there is no document to click on, so no need to check to see if file exists (as you had asked in a previous question).
TocacarConnect With a Mentor Commented:
@rvfowler2 - I can contact TomDWallace on your behalf and ask him to assist with this question.  I will send him the link today.
This is achieved with a webviewer on the filemaker page.  I use an html upload form and then php to handle and store the files. The php scans a directory relating to the ID of the filemaker record and lists all the files for that one record. These become weblinks to display the files in the webviewer. There are quite a few steps to this and obviously requires a web server with php with enough disk space for all your files.  It can be hosted totally separately from your filemaker server.  The response times are very good and it behaves fairly seemlessly in the filemaker window.  I have customised it for displaying .PDFs  for example.
rvfowler2Author Commented:
Talked with my web guy and he'd rather not upload that many files to our external web server (we're talking about 700 x 5-10 at least), so I'm going to try the ChallengeDay's container soluton.  ChallengeDay, do you have an example?  I'm trying to picture it.  I've already done a lot of buttons with variables equal to file paths that open documents based on the record that one is on and I'm very familiar with portals.  While waiting for your reply, I'm just going to splash around a bit and see what I come up with.

Also, not sure of the function of your GetAsText(FileContainer), but I've never worked with containers, so the question may be answered by splashing around.
rvfowler2Author Commented:
And to clarify, we have 5 standard or most common documents that I am creating 5 seperate Tabs taht will contain the container fields in.
Hi rvfowler,

Sorry, don't have a working sample, and unfortunately no time right now to create one.

However, I found this video which gives a good starting point.

Ignore the image in the video, what you'll get will be the document icon (since you are using documents and not pictures).

You'll want to use the "reference" option. It's mentioned at about 4 min in in the video.

Yes, splash around! Post back here w/questions.
>Also, not sure of the function of your GetAsText(FileContainer), but I've never worked with containers, so the question may be answered by splashing around.

What you'll find is that the container shows you an icon, but you'll also want to know the path. Remember, users will be inserting the files you won't know ahead of time what the path is. It'll be up to you to train them to save them in the right folders and insert them into the container.

GetAsText(FileContainer) will give you the full path and name of the file referenced.
rvfowler2Author Commented:
And... even more fun:  Is there a way to create folders dynamically because each month we lose tenants and we gain some?
Yes, you can have FM run a batch file using the SendEvent script step. Yup, lots of fun :)
rvfowler2Author Commented:
I think I have asked too many questions for one post, so am breaking this up.  Credting Tocacar for bringing me a resource even though we didn't use it.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.