Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


gczychi last won the day on October 14 2016

gczychi had the most liked content!

Community Reputation

1 Neutral

About gczychi

  • Rank

Profile Information

  • Title
  • Gender

FileMaker Experience

  • Skill Level
  • FM Application
    16 Advanced

Platform Environment

  • OS Platform
  • OS Version
    Yosemite, El Capitan, Sierra, Win 7

Recent Profile Visitors

2,396 profile views
  1. Thanks, Kaizentu, it’s not really elegant, but nor is FileMaker scripting. For Loops, I'm ususally using the self resetting loop script from fmstandards, which is pretty cool (see picture). But FileMaker shouldn’t consider these instances as errors. So, what could prevent the no records found «error» to appear in the event list? Thanks, Gary
  2. Browsing through my event logs, I am finding weird scripting errors, like: ... Information 645 ...local Schedule "Import Main (every minute 8-20)" scripting error (401) at "Import : Import Main : 36 : Perform Find". How can a simple «Perform Find» script step (which works just fine in the server scheduled script, btw.) generate a scripting error? Occasions where the FoundSet = 0 should be considered «normal». I also have found other errors, that shouldn't be errors, like «Go to Record/Request/Page [ Next ; Exit after last ]», when there is no next Record. What is the best way to prevent this? It’s clogging the log files. Thanks a lot for any insight! Gary
  3. That did the trick! After I changed the field to text, everything works now as it should. And the problem inserting «1¶2¶3» was also related to the wrong field type. Thanks a lot!
  4. I have a Number field «Kontakttyp_enum». It contains multiple (!) number values, depending on what the user has deemed to select (see picture). It works great — numbers appearing and disappearing in this field, depending on which checkboxes are clicked upon. Now, I’d like to set this field with the «Set Field» script step — but I can’t figure out how. I can read specific values (for example with the function «Position ( Kontakttyp_enum ; 6 ; 1 ; 1 )», but I don’t know how to add or remove a specific number. Has anybody any insight on this? It’s quite interesting. Even though it is a number field, the numbers seem to be delimited by Return characters (¶) — at least this is the way the field content is displayed on the layout. But when I insert a return-delimited list, the checkboxes break. For example, when I insert «1¶2¶3», no checkbox is crossed. And when I then click a checkbox, the same number is inserted again. Thanks a lot for any hints! Gary
  5. Hi, good idea. However, since the PersistentID is not unique (see: https://community.filemaker.com/thread/85477), it would create a lot of hassle to work with this one. Thanks, Gary
  6. It’s not as easy as: PatternCount ( Get ( ApplicationVersion ) ; "Server" ) Anyone know how I can determine if the FM application (FMP or FMPA, not Server) that a script is running on is the client or the server application? When using a remote database that is hosted on a FM application (not FMS), speed is very often an issue. So I need to determine if a script is executed locally on a FM application that is acting as the server (fast) or if the script is running on a client FM application accessing a remote database (slow). I would need to Exit the Script in the latter case. Checking the computer name (how can you do that?) would probably work, but is not very "safe". Any ideas how you could do that? Thanks a lot for any ideas, Gary
  7. OK, I have found the problem: The account that I use in FMS to execute the script was not defined in both files, but only in one. Makes sense. So, in order to be able to access data in an external data source, the same account which FMS uses to execute the script needs to be present in both files.
  8. FMS17: In my Import.fmp12 database, I have specified an external FileMaker database file:Main.fmp12 and added a couple of table occurrences to this file (with the same names as in Main.fmp12) and added the corresponding layouts. When I open Import.fmp12 from a client, I can see and work with all records of the Main.fmp12 file, just fine. From the client, I can also run any script just fine. However, when I run the same script as a scheduled script from the server (only with server compatible script steps, of course) the script runs, but I can’t see any record ! Here are some script steps that I use: Go to Layout [ “Kontakt” (Kontakt) ] Show All Records Set Variable [ $id_Käuferbetrieb ; Value: Let ( [ ~fmsql_execute = True ; ~query = " SELECT id FROM Kontakt WHERE Betriebsnummer = ? " ; ~columnSeparator = Tab ; ~rowSeparator = ¶ ; ~result = … ] And this is what I get: (Import is a local table and a local layout) LayoutName: Import RecordCount/FoundCount: 1324/30 LastError: 0 (Kontakt is a local layout with data from a remote table of an external data source from Main.fmp12, with TO «Kontakt») LayoutName: Kontakt RecordCount/FoundCount: 0/0 fmsqlresult: ? LastError: 0 I’m puzzled — Any idea what’s wrong? Thanks a lot for any help! Gary
  9. Hi, we're using Rest API and we are not using FileMaker web hosting. Therefore, a landing page like «FileMaker Database Server Website» doesn’t make sense for us (looks a little bit like the Boston T in blue). Better would be to redirect a user to the company website, which resides on another server and has another subdomain. I’m not sure where we could change that, but it may be something like: Redirect all requests for FileMaker’s landing page, which are not for port 443 OR does NOT contain the string "/fmi/data/v1/databases/DATABASE/sessions" to "www.anotherwebsite.com:80". Other services, like ssh, vnc, should not be affected. Where and how would something like this be configured? A good new year to you all, Gary
  10. SOLUTION Since no one seems to be interested enough, I thought I come up with a solution (more than a hack, but hey, it works ;-) Here again, the categories: Main Category «Vehicle»: «Car», «Agricultural Vehicle», etc. Sub-Category «Car»: «Roadster», «Limousine», «Van», etc. Sub-Category «Agricultural Vehicle»: «Tractor», «Transport Vehicle», etc. Whenever I choose «Car» as vehicle, I want to see in my sub-category value list «Roadster», «Limousine», etc. When «Agricultural Vehicle» is the main category, I want the second value list to show «Tractor», «Transport Vehicle», etc. So, this is what to do: You go about it exactly the same way as before (for a normal value list): Set up a 1) global field in your ValueList:: table, add a 2) self-joined Table Occurence of ValueList:: using the previously defined global field for the relation, add a 3) number field in your Layout table containing the value that the user will choose (my table name is Fahrzeug::) and 4) add a value list the same way like before. The only thing slightly different is the global field in ValueList. It mustn’t be a calculation field anymore, but a normal text field — still global. It’s value needs to change whenever the main category value changes. That is: When the user changes the main category (say, from «Car» to «Agricultural Vehicle»), or when the user goes to another record. This can easily be handled with Script Triggers. In my case «onObjectSave_MainCategoryField» and «onRecordLoad_myTable» are doing that job. Both script triggers call a script that updates the global field in the value list table (see picture). Hope this makes sense :-) This is more a hack than a solution, and I am sure there is a more elegant solution. Also, it would be nice to be able to sort the value list in a different way than the A-Z FileMaker sort order. So, if anyone has an idea to make this work without script triggers, that would be way cool. Thanks, Gary
  11. I wanted to extend Matt’s proposed use of value lists in his Scriptology Mastery Course to use Conditional Value Lists — but I failed 😞 There’s not much missing, any idea on how to do such a thing? Thanks! )
  12. Hi, being inspired by Matt Petrowsky’s YouTube video (Lesson #2: Scriptology Mastery Course FileMaker; BTW a great video series!) I added a "ValueList" table to my solution and it works just fine. However, I can’t make conditional value lists work. I'm lost! In the example that Matt gives, you set up a ValueList table containing all the category/value pairs of your whole solution and make a self joined relationships to that table for all value lists you would like to see. Keys are text constants that you define that hold the exact category names. Please see below the attached ValueList Table.jpg definition and the ValueList Values. In my solution I have a "Fahrzeugklassen" value list and two other value lists that are dependent on that list. For example, when I choose the item "PKW" from the Fahrzeugklassen list, I would like to see all values of the PKW value list and insert the Enum of that value into my table. In my table Fahrzeug:: I have two fields, Fahrzeug::Fahrzeugklasse_enum and Fahrzeug::Kategorie_enum that hold the Enum numbers of the ValueList:: When I click on the field Fahrzeug::Fahrzeugklasse_enum, I see a list of all Fahrzeugklassen (see picture Fahrzeug Layout 1). When I choose one, it inserts the corresponding Enum number of ValueList and displays ValueList::TheValue. That works using a self joined relationship with a global "Fahrzeugklasse" as the key (see below TO.jpg and Value List Definition.jpg). Fahrzeug::Fahrzeugklasse_enum is now filled nicely and I would like to choose a sub category depending on that value. In my example, it is "11", meaning "Agrarfahrzeuge" (agriculture vehicles). When I now click on Fahrzeug::Kategorie_enum, I would like to see all possible values depending on that "11-Agrarfahrzeuge" value: "15-Traktor", "16-Transportfahrzeug" and "17-Andere". What do I have to do? What kind of fields and relationships do I have to create? Thanks so much for your help! Gary
  13. Thanks, Wim! There are actually a lot of things that need to be checked. That can be tricky for someone like me who is dealing with Rest APi for the first time. Maybe someone can benefit, so I'll summarizing my experiences: 1) Read the FileMaker documentation – FileMaker Rest API Documentation – On your own FM Server, read the help pages (for query syntax): https://localhost:16000, chapter Web-Publishing Resources > FileMaker Data API Documentation. 2) Enable Rest API on the server Enable Web Server in Web Publishing pane, check your IP address and ports. Sticking with the default ports 80/443 is probably the easiest, though this will make it difficult when you already have another web server running on the same machine. 3) Prepare the FileMaker database – Username, Password protected (Password must consist of printable characters; no colon) – Open your database in FileMaker 16 and set the database to access fmrest requests: This is being done in File > Manage Security (can't do this on the server or with FM 15). – For testing, it’s a good idea to enable WebDirect as well, checking if you can reach the FM Server at all — in case you are having SSL Certificate problems (like me :-). Everything is ok with the file, when after uploading to the server, in the Activity pane there is a big gray dot in the column «Rest» of your database file. 4) SSL The API only works with SSL (in fact TLS 1,2). You will need officially signed certificates. I didn't and ran into a lot of problems. You will need to import it into the FM Server: Admin Console > Database Server > Security If you want to go without SSL, it will depend on your environment whether it will work. When testing the API functionality with ARC plugin for Chrome (great tool) or with Postman (a little bit less intuitive), you can turn SSL checking off. That might do the trick for you. Any production environment will be problematic without a proper certificate (as Wim indicated) and I wouldn't do it, even if it would be possible. In any case, you must use https, not http. 5) The other side The majority of users will probably use PHP on the client side. There are at least 2 wrapper scripts that you can use, fmrest for php and FMDataAPI, of which «fmrest» seems to be better, as it handles the validation process: With every command you send to the FM Server, you need to pass a token, that you need to receive from the server beforehand. fmrest for php does this management for you. That is cool. I hope this is helpful for someone For me, it was :-) Gary
  14. Hi, I want to access a data base «Import.fmp12» hosted on FMS 16 with the new Rest API but cannot get it to work. Testing with «ARC Plugin for Chrome» (great tool, btw) and Postman. In ARC, I get the error 802 – Unable to open file; in Postman, I won't even get that far: «Could not get any response» This is what I did so far: – The file is accessible fine with any FileMaker client using FileMaker username and password (triple checked spelling, etc.) – Can connect fine to WebDirect with any browser and http – Cannot connect using Rest API and http, so went for https – Got an authentication error with https, so – Installed a self-signed certificate both on the server Mac and on local Mac for my myowndomain.com Getting mixed results: – Firefox: myowndomain.com certificate: Error code: SEC_ERROR_UNKNOWN_ISSUER (to be expected) – Safari: FMI Default Certificate: Certificate not valid (host name mismatch). For whatever reason, Safari doesn't use my certificate. – Chrome: strikethrough https but shows the WebDirect server – ARC Plugin: Using https://myowndomain.com/fmi/rest/api/auth/Import Can get now through to the server (no SSL-Auth problems anymore), but the result is: {"errorMessage": "Unable to open file","errorCode": "802"} – Postman: Using https://myowndomain.com/fmi/rest/api/auth/Import «Could not get any response» and an error message: «{"errorMessage":"Method Not Allowed"}» Any ideas? Thanks for any help. Gary
  15. Oops… Thanks for the explanation. It's my habit of testing everything in the data Viewer before copying it into the scripts — saves me a bit of work during debugging. Thanks so much, Gary
  • Create New...

Important Information

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