Jump to content

Link to Google Doc/Pdf files


This topic is 1507 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi,

As a complete novice to FMP, I'm attempting my very first database. We rely on storing our contracts on Google & Dropbox. I've been trying to either embed the pdf's into a "tab", or (my preferred option) to have an "Add URL" button to link to the online pdf.

I tried adding a field and copying and pasting the URL, but it's not clickable, and I'd need to add another field for each pdf/contract.

Is there a better more efficient way to do this?

Thanks

Steve

Link to comment
Share on other sites

Hi Wim, 

Thanks for your reply - we've been using Podio as our "contacts CRM/database" for a couple of year's but have become despondent with it for various reasons. In that system, we had the facility to "add a document". Clicking on "Add Document" produced a new field, into which we could add the URL of the Google pdf/pdf we needed to locate from within that contact's information sheet.

The URL was then "clickable" so as to allow one-click access to our document via the default browser.

Is it possible to make a button to do something similar in FMP 18?

Hope that makes sense?

Edited by St3v1e
Link to comment
Share on other sites

Thanks Wim, 

OK I'll check that out, thanks.

We add pdf's, Google Docs to these contacts frequently, and so these fields need to be created regularly - is there a method by which I can simply Click a button to add a field with these attributes already included.

The objective is to click an "add Document" button, which produces an additional field, into which I can add the URL, which will link to the URL/Doc when clicked inside the contact window? Usually we have no more than 8-10 of these per contact, so it's easy to allow space on one side of the contact area.

Link to comment
Share on other sites

The documents should be its own table, related to the contact by the contact ID so that you can attach an unlimited number of documents per contact (even if you don't need a very high number: you do not want to create document fields in the contacts table).

The "add a document" button would then fire a script to take the user's input and create a new related documents record.

  • Like 1
Link to comment
Share on other sites

Thanks again Wim,

Lots to research for me here, but I understand the principle idea.

As I mentioned, I'm a total newbie to FMP and have not yet learned how to insert scripts, but will try to use your suggestions and learn the process.

 

Link to comment
Share on other sites

Wim, 

After several hours, I've managed to figure out how to set the button to trigger a script to open a URL I've entered into the field adjacent to it. But I'm struggling to work out the 2nd part of the issue: How to make the button create a new field/button with the attributes I need. 

I'm anticipating the "Add New Document" button would perform like so:

  1. Click the "Add New Document" button
  2. Script performs the following:
    • If the field above is empty (ie: no text) show me a dialog "Enter URL into empty field".
    • Add new field to database (if new button & text field are created, if not ignore).
    • Makes new button & text field directly below the previous one.
    • If there's a URL (text) already entered in the field, make new button & text field directly below to replicate the previous button, with the same attributes (ie: Open URL button linked to new field).
    • When a new URL is entered, assign it to the adjacent button, but allow me to name the URL independently 
    • When completed, each button (icon to the left) when clicked, should open the link to the relevant document (usually in google Docs).

I know all this is possible with Applescript, but Is this is possible in FMP 18?

Thanks for any guidance to Tutorials or help you may be able to provide.

Example:

233383957_ScreenShot.png.508c6dff13d11f1c431f044948b6d9d1.png

Edited by St3v1e
Link to comment
Share on other sites

It is not possible to add new fields to a database programmatically. Or add objects, such as buttons, to a layout. 

What you can (and should) do is add a record in a related table for each document linked to the current contact. This can be done directly by entering data in a portal (provided creation of related records is allowed in the relationship's definition) or by a script. The same portal can also display a button in each populated row.

 

 

  • Like 1
Link to comment
Share on other sites

Thanks for your reply comment.

The "Add New Document" button references a table by the same name, and the "pdf" buttons to the right, also reference fields within that table. I also have a 2nd table "Contacts" within the same layout.

Could you be a little more specific about entering the data into a "portal". How would that be done?

 

Edited by St3v1e
Link to comment
Share on other sites

1 hour ago, St3v1e said:

What am I misunderstanding here?

I am not sure. Perhaps the meaning of "programmatically"?

Every solution has a schema part and a data part. The schema part includes tables, fields, relationships, layouts, scripts, etc. Ideally, the developer would devise a schema that can handle any and all data that the users will create. But you are asking for a script that would add to the schema - and that's not possible. You need to find a way to add new documents as data.

 

Link to comment
Share on other sites

2 hours ago, St3v1e said:

Is FMP 18 able to utilise Applescript scripts? 

Filemaker's support of AppleScript has not changed since version 6, I think (possibly even earlier). Do you have a specific task in mind?

Edited by comment
Link to comment
Share on other sites

Quote

It is not possible to add new fields to a database programmatically. Or add objects, such as buttons, to a layout.

Just wondering if an Applescript can be written for the "Add New Document" situation?

Link to comment
Share on other sites

Many thanks,

I have an Applescript Developer who may be able to help with the scripting.

One other question, I'm confused about the portal window & inserting it into an existing layout.

After making sure there's at least some info in the fields of the other table I want to insert, the window shows nothing. I can do a search on these forums, but happy to receive any comments you'd care to make.

Thanks

Link to comment
Share on other sites

12 hours ago, St3v1e said:

I have an Applescript Developer who may be able to help with the scripting.

 

If the user is already in FM when that piece of the workflow starts then it doesn't make sense to do this in AppleScript just because you have an AppleScript developer.  This would be the time to push through and figure out how to make this all work in FM.

 

 

  • Like 1
Link to comment
Share on other sites

Comment: Fair response, I have tried to figure this out, but in between work, family, kids and health, my  time is limited to work on these issues. For now I'll have to use the file as-is and hopefully figure it out using a test file. Appreciate your reply.

Wim: Ditto my comments above.

But Comment said:

Quote

It is not possible to add new fields to a database programmatically. Or add objects, such as buttons, to a layout.

However, my Developer said it can be done using an Applescript inside of FMP, so if it can't be done just using FMP, alone - why wouldn't I want to utilize his help to achieve the desired result? Time is not on my side just now, hence why I joined this forum - to try to fastrack to a point where I can get things running to some level.

Link to comment
Share on other sites

48 minutes ago, St3v1e said:

my Developer said it can be done using an Applescript inside of FMP,

No, it cannot. Well, in theory, you could program the AppleScript to perform a developer's role by mimicking key presses and mouse movements - but I don't think you would get very far with this in practice. 

  • Like 1
Link to comment
Share on other sites

Hi Steve, you've been receiving advice from two of the top Developers and their suggestions are sound.  Using a portal with related records is a VERY SIMPLE technique and process once you grasp the concept.  I highly suggest you just take a few moments to understand how a relationship works by reviewing Comment's file.

It would take far less time and effort than using AppleScript and it is a basic understanding of FileMaker.  I wish you well on your project.  🙂

Link to comment
Share on other sites

I should add that there is a way to add fields programmatically, using ODBC. However, the real question here is not "can it be done",  but rather "should it be done". And the answer is categorically no. Having a field (or more precisely, a set of fields) for each document would be very poor structure. Just consider, for example, what would it take to find contacts with a specific document type.

 

Link to comment
Share on other sites

Thanks LaRetta/Comment - I'm considering the situation as per your remarks - Comment: Never having done this previously, I'm anticipating the place to start would be a good old piece of paper to map what I need and how it might all come together? Then move forwards, start building piece by piece, table by table, workspace by workspace?

Is that type of process recommended (before I get too far in)?

Link to comment
Share on other sites

This topic is 1507 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.