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

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?

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

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.

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

 

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

 

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

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

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

 

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

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

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.

 

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

Link to post
Share on other sites

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
  • Similar Content

    • By dancer5678
      I am using Filemaker Server 18 on Windows Server 2012 R2
      Been using it for years with no issues
      Currently when I log in to the console it is very sluggish.
      When I get to the Dashboard it shows No databases, then it auto refreshes and the database list appears.
      Within 15 seconds of scrolling the database list to open files the screen refreshes. This situations is happening over and over in a loop.
      Any Thoughts on what is causing this issue?
       
       
       
       
    • By stevaroni
      I get an error 3 when using a script to Export Records via WebDirect. Using FileMaker Server 18 and have tried both Safari and Chrome both with same results. I have tried using the temporary path, desktop path, and documents path. I have tried using with the automatically open and not. I have tried writing a tab delimited and comma delimited file. Does anyone have ideas I haven't yet tried?
    • By cheerfulzebra
      Hi All
       
      I am hoping some one can help!
      I have a table called TPM, in that table is a field "Next Due Date" Which is auto generated by creating a new record. You input the date you did the service and then it adds 3 months to that date and that appears in the Next Due Date Field.. All working...
       
      What I am trying to do is when the database loads it runs a script to see if there are any outstanding TPM Services to do...
      Here is the script
      Show Customer Dialog
      Message: If ( TPM::TPM Next Due Date < Get (CurrentDate ) ; "You have outstanding TPM services" ; "You have no outstanding services")
      I thought it would be that simple. So I created a TPM Due date Less that Current date and ran the script...."You have outstanding TPM Services"...GREAT! Then I deleted that record and ran the script again...""You have outstanding TPM Services" Oh!!! That isnt true!
       
      PLEASE HELP I'M LOOSING THE WILL TO LIVE HERE!!!
    • By Kitesurfer
      Hi,
      Can someone please explain why Leftwords function is not properly working when importing an excell sheet.
      For example the name John Doe LeftWords ( Client ; 1 ) should show "John" only.
      When typing John Doe it works fine but not when importing ????
      Looking forward to a reply.
      Kind regards
      Rudy
    • By Pio Soto
      Hi,
      My issue is that my customer layout has a script trigger on LayOutEnter that sorts my customers portal list by "Active" customers,
      but when I do a go to related record from another table say from quotes or any other the customer layout does not load that customer
      or show my related customer because the OnLayoutEnter script trigger changes it, I would like it to go to the related customer and also sort it by "Active"
      on the list.
      Hope someone can help me with this.
      Thanks,
      Pio

×
×
  • Create New...

Important Information

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