Jump to content

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

Share this post


Link to post
Share on other sites

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

Thanks.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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.

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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.

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Is FMP 18 able to utilise Applescript scripts? 

 

Share this post


Link to post
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

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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.  🙂

Share this post


Link to post
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.

 

Share this post


Link to post
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)?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Similar Content

    • By johnmarcel
      I have setup a layer with web viewer. I can maneuver within the website just fine but, I would like it if when the website loads it would send 4 carriage returns to get to a specific field within the website.
      If anyone has any ideas on how I can accomplish this it would be greatly appreciated.
       
      Thank You
      John
    • By john renfrew
      Have copied a shell script which works in other settings onto a new machine
      Changes paths - it zips a backup folder and does a ditto command to copy as a zip file to an external drive
      I worked out that I needed to change the sudoers file to allow no password access to the script. Running the shell script in terminal was requiring a password, now it doesn't 
      Added the fmserver user to that too.
       
      If I run the sh script from the admin console as fmserver it fails straight away, if I run it as the local user with its password it appears to run but in fact times out with a fail message, both of which are about invalid account name or password
       
      The script is working fine when run through terminal, doe not require password, just not when triggered from console.
      Does anyone have any light to shine on this???
    • By Otis
      Actually, I guess this could apply to macOS Mojave as well, but is there any way to get the Send Email script to work when creating a Runtime solution in macOS Catalina?
      I'm using FileMaker Pro Advanced 18 to create my runtime solution. I created a button on my main menu to send an email. When I click the button in High Sierra (and all previous macOS versions) it works. But in macOS Mojave and Catalina, nothing happens.
      I know that Apple placed security limits on applications, but there's no way to add my runtime to the list of allowable applications to execute a script. What is supposed to happen is that macOS is supposed to have a pop up that allows you to click to allow this application to run scripts and access mail.app. So this works in FileMaker Pro Advanced 18. However, when I covert my solution to a Runtime, it's no longer "FileMaker Pro Advanced" and instead is considered a Runtime app.
      In macOS Catalina, manually adding my runtime solution to this area didn't work: System Preferences > Security & Privacy > Privacy (tab) > Accessibility > (Allow these apps below to control your computer)
      Is there any way to allow a runtime to have a simple button to click Send Email in Catalina?
      I'm stumped.
    • By Faldo
      Good morning
      I was wondering if anyone had template for a basic home accounts sytem or the schema for the databases.
      Thanks again.
       
    • By Peter Wagemans
      macOS Catalina.
      1. Make a new file and save it to the desktop
      2. While the file is open, move it to the trash
      3. empty the trash
      The trash is emptied without any error. Weird. This does not seem right, in fact it seems VERY wrong. Can anybody reproduce?
×
×
  • Create New...

Important Information

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