Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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

  • Author

 . . . Hi, is this the correct place to post this question?

Thanks.

Yes it is.  Can you tell us a little more about the "clickable" that you are after?

I assume you store the URL in a regular text field?

  • Author

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

If you want the user to be able to open that URL in a browser, just add a button next to the URL field (or make the field a button) that uses the "Open URL" script step, using the value of the field.

  • Author

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.

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.

  • Author

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.

 

No problem.  Come back with any and all questions, we all had to go through the initial learning curve at some point.  

  • Author

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

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.

 

 

  • Author

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

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.

 

Sorry, I did not see your edit before posting.

Have a look at the attached demo. To add a new document, just type into the first empty row of the portal.

Portal.fmp12

Edited by comment

  • Author

Hi comment, many thanks for the example. Looks very useable.

Is FMP 18 able to utilise Applescript scripts? 

 

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

  • Author
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?

Yes. If you have the necessary data, then AppleScript can tell Filemaker to go to the Documents layout, create a new record and set the ContactID, Description and URL fields with values.

 

Edited by comment

  • Author

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

Sorry, I am not going to guess what's wrong with a file I cannot see. You have a working file, see if you can spot the difference. If not, post a copy of your file (preferably minimized to only what's necessary to show the problem).

 

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.

 

 

  • Author

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.

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. 

  • Author

OK thanks again for the help in getting started. All very much appreciated.

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.  🙂

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.

 

  • Author

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)?

Yes. I thought you had this worked out already, but you should definitely start with an ERD.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.