Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Chuck last won the day on November 27 2018

Chuck had the most liked content!

Community Reputation

5 Neutral

About Chuck

  • Rank
  • Birthday 06/16/1971

Profile Information

  • Gender
  • Location
    Hemet, CA
  • Interests
    Software development, history, classical literature, chess, scouting

Contact Methods

  • Website URL
  • Skype

FileMaker Experience

  • Skill Level
  • FM Application

Platform Environment

  • OS Platform
  • OS Version
    High Sierra

FileMaker Partner

  • Certification

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Well, never mind. I got into contact with Goya and the developer tells me that it used to work and now doesn't because of a change they made to what function BE_ExecuteSystemCommand calls, and now it won't allow the stringing of shell commands. So I did it with Keyboard Maestro instead.
  2. I'm trying to use the BaseElements plugin to execute an AppleScript a few seconds after the FileMaker script (the AppleScript creates a DDR using interface scripting and doesn't seem to work when using Perform AppleScript). This used to work, but I think the new security settings for macOS are preventing it from doing so now. The calculation being used to execute the AppleScript is BE_ExecuteSystemCommand ( $_cmd ; 0 ) where $_cmd has something like this: (sleep 2 ; osascript "/var/folders/2d/1p6b7tb14tl_g3rrfjyn_jp40000gn/T/S10/create_ddr.applescript") & If I paste that command into the terminal, it works fine, but Terminal has permission in System Preferences to control the computer. FileMaker has the same permissions, but I assume BaseElements is a separate process and would also need permission, and that's why nothing's happening. Am I correct? If so, is there a way to give BaseElements the permission? If not, what else might the problem be?
  3. Just an alternative that I've used in similar situations, which I find more readable and understandable: First Name: GetValue ( Substitute ( SUPPLIED NAME ; ", " ; "¶" ) ; 2 ) Last Name: GetValue ( Substitute ( SUPPLIED NAME ; ", " ; "¶" ) ; 1 ) Converting text delimited with a specific string to a list often makes parsing it much easier.
  4. I have a client who uses a report of many records. Some of the records could have an image appear before the record's details. Occasionally, depending on the length of the descriptions in the previous records, the image will be split across pages. Turning off "Allow part to break across page boundaries" does solve this problem, but has the unwanted side-effect of producing large amounts of whitespace when it's not needed to prevent this issue. So far the only inkling of a solution I've come up with is to check the report one record at a time, temporarily emptying out the description, adding the next record, see if that record has an image and then see if adding that record added a page. If so, add lines to the previous record's description until that adds a page, take out the line that added the page, then add the next record, and restore that record's description. Seems like it would do the job, but also seems like a lot of work for something that I would think could be simpler. Has anyone come up with a simpler solution?
  5. I have FileMaker Server 17 running on my local machine. I'm trying to use the command line to backup a single file to a folder in my home folder using the following: fmsadmin backup filename -dest filemac:/Aslan/Users/chuck/project/folder/ Although it's unusual for a command line path to be specified as above, that's how the fmsadmin help backup help text specifies it should be (although I've tried using the standard POSIX path). This always returns (after entering my credentials) "Error: 20500 (Directory not found)". I tired giving the fmserver user the read/write privileges for the folder to no effect. Never mind. I found it. `-dash` needs to be `--dest`.
  6. I've tried committing the records, refreshing the portal, refreshing the window, even entering layout mode and returning to browse mode doesn't fix the problem. It only seems to get fixed when I change the filter calc. I'm familiar with the various techniques published at FileMaker Hacks, but those aren't working because they don't allow for attribute data in the join file. Are there other known technique to accomplish this?
  7. I apologize. I was trying to abstract out the problem from the specifics, and the actual tables would require quite a bit of explanation to get a handle on, but I can present the problem in terms that are, I hope, easy to understand. Make X PERSONS and Y MEETINGS with the join table ATTENDEES. PERSONS and MEETINGS each have primary keys named id. ATTENDEES has two foreign key fields, person_id and meeting_id. People has one table occurrence: PERSONS. ATTENDEES has a TO: persons_ATTENDEES. Relationship between these two is PERSONS::id = persons_ATTENDEES::person_id. MEETINGS has one table occurrence: persons_MEETINGS~cross that is a cross join. While on layout with PERSONS context, portal into persons_MEETINGS shows meetings the person is attending. I want portal into persons_MEETINGS~cross to show meetings the person is not attending. I'm doing this by filtering out records where the persons_MEETINGS~cross::id is not in the list of persons_MEETINGS::meeting_id. So, perhaps there's a better way to do this, but this is working after I edit the filter calculation. But it doesn't stay working. I'll add an ATTENDEE record for the current person to one of the meetings, and the meeting still shows up in the persons_MEETINGS~cross portal. But, if I edit the filter calc, not so it returns a different result, but just rearrange it somehow, perhaps use Let variables or change it from using Let variables to a direct calc, the portal updates.
  8. Three TOs: X with X as base table, x_XY with XY join table as base table, and x_Y~cross, with Y as base table. X related to x_Y with X::id = x_XY::x_id. X related to x_Y~cross with cross join. Goal: portal into x_XY shows linked records, portal to x_Y~cross shows unlinked records.
  9. I have a many-to-many relationship with a join table between two tables, X and Y with join table XY. While viewing a record in X I have a portal of all the join records in XY that are linked to X. I'd like to show a portal of Y of all the records not linked. I sort of have a solution. I have a cross going from X to Y and a filter with the following calc: IsEmpty ( FilterValues ( x_Y~cross::id ; List ( x_XY::y_id ) ) ) This works as soon as I edit the filter calculation, but as soon as records get linked or unlinked, the filter is wrong. If I edit the filter calc, it updates. Refreshing the portals and window, even going to layout mode and returning to browse mode, don't show the correct records in the cross join portal. Any suggestions for how to do this?
  10. I know I've done this before, but can't find an example of the functionality in my archives and can't seem to work out how to do it again. I've got two tables: PERSONS and CONNECTIONS. PERSONS has an `id` field and CONNECTIONS has `person_1_id` and `person_2_id`. There's a relationship from PERSONS to CONNECTIONS with `id` = `person_1_id` and from CONNECTIONS to another TO into PERSONS, connections_PERSONS, with `person_2_id` = `id`, but these relationships may need to change to make this work. On a layout with a context of PERSONS, I need a portal into CONNECTIONS that shows the names of the person on the other side of the relationship. So if Bill and Ted are connected, when viewing Bill's record I see Ted in the portal and when viewing Ted's record I see Bil's record.
  11. OK, I fixed it, and the process might be interesting. Here's the original calc. Case ( dev.IsSet ( c_score_cache ) ; math.Fractile ( c_score_cache ; List ( prsn_PRSN~cross::c_score_cache ) ; 7 ) ; dev.Nil ) I started unwrapping the custom functions. `dev.IsSet` is just `not IsEmpty` and `dev.Nil is an empty string. Here's `math.Fractile`: // math.Fractile ( _value ; _list ; _pieces ) // Purpose: Return which fraction of a list of numbers the value appears in. // Parameters: _value: The value to get the fractile of // _list: The list of value the value is found within // _pieces: How many pieces to break the list into // Requirements: list.ValuePosition // math.RoundUpTo // Version: 1.0 - Charles Ross - 17-12-10 // Notes: Fractile is my own term for percentail or septile where the number of pieces determined by a parameter. // Percentiles can be computing by passing 100 to `_pieces` for example, and septiles by passing 7. Let ( [ _list = SortValues ( _list ; 2 ) ; _pos = list.ValuePosition ( _value ; _list ; 1 ) ; _count = ValueCount ( _list ) ; _fraction = _pos / _count ] ; math.RoundUpTo ( _fraction ; 1 / _pieces ) * _pieces ) I was mistaken earlier when I said there were no recursive functions being called. `list.ValuePosition` is, so for the time being I left that in. Unwrapping the three custom functions in the original calculation: Case ( not IsEmpty ( c_score_cache ) ; Let ( [ _list = SortValues ( List ( prsn_PRSN~cross::c_score_cache ) ; 2 ) ; _pos = list.ValuePosition ( c_score_cache ; _list ; 1 ) ; _count = ValueCount ( _list ) ; _fraction = _pos / _count ] ; math.RoundUpTo ( _fraction ; 1 / _pieces ) * _pieces ) ; "" ) At this point, the behavior was the same. So I unwrapped `math.RoundUpTo`. That function is: // math.RoundUpTo ( _number; _precision ) // Purpose: Rounds the number up to the nearest multiple of the precision. // Parameters: _number: The number to round. // _precision: The multiple to round to. // Version: 1.0 - Mikhail Edoshin - 06-01-01 // Notes: http://web.archive.org/web/20100122090742/ // http://edoshin.skeletonkey.com/2006/01/rounding_to_a_g.html // To round time use a precision that is the number of seconds you want to round to, for // example, a precision of 300 would round to the nearest 15 minutes. // To round currency to the nearest quarter, use a precision of 0.25. // Example: ( math.RoundUpTo ( 5 ; 2 ) = 2 ) // and ( math.RoundUpTo ( Time ( 1 ; 23 ; 45 ) ; 15 * 60 ) = Time ( 1 ; 30 ; 0 ) ) Ceiling ( _number / _precision ) * _precision Unwrapping that in the calculation brings us (with the addition of parentheses where necessary to preserve the original) to: Case ( not IsEmpty ( c_score_cache ) ; Let ( [ _list = SortValues ( List ( prsn_PRSN~cross::c_score_cache ) ; 2 ) ; _pos = list.ValuePosition ( c_score_cache ; _list ; 1 ) ; _count = ValueCount ( _list ) ; _fraction = _pos / _count ] ; ( Ceiling ( _fraction / ( 1 / 7 ) ) * ( 1 / 7 ) * 7 ) ) ; "" ) Again, at this point, the behavior hasn't changed. But that straight substitution above isn't necessary. Outside the `Ceiling` call we're multiplying by 1/7 and then by 7. That's redundant. Case ( not IsEmpty ( c_score_cache ) ; Let ( [ _list = SortValues ( List ( prsn_PRSN~cross::c_score_cache ) ; 2 ) ; _pos = list.ValuePosition ( c_score_cache ; _list ; 1 ) ; _count = ValueCount ( _list ) ; _fraction = _pos / _count ] ; Ceiling ( _fraction / ( 1 / 7 ) ) ) ; "" ) At this point, it works. So my guess here is that at the end, even though everything said the field stored the value 5, it was actually something like 4.99999999... because of the division and multiplication by a number whose reciprocal wasn't easily represented in binary, or, in math ( 1 / 7 ) * 7 = 1, in FileMaker, not exactly. When I asked for the value at index 4.9999... it truncated it and gave me the value at index 4. If the client had asked for octiles instead, with 1/8 exactly representable in binary, it probably wouldn't have been a problem. I went back to the original calculation's form, but edited the math.Fractile function to round to the nearest integer before returning the result.
  12. Commenting out the field's calculation and setting it to `GetAsNumber ( 5 )` worked. The first calc I quoted returned `5¶1¶1¶1` instead of `5¶1¶0¶0`. I did create a new `c_seventh_2` field and copied and pasted the calc, and that failed to work just like the original field. I've been doing all this on a developer field in table view, but going to a user layout shows the same problem.
  13. I thought of that, which is why the first example has the "GetAsNumber" function. But `"5" = 5` returns 1, so that's not likely the source of the problem. And even if it were, that doesn't explain why it's getting the item before the one it should. I can only think of two possible explanations so far. Either there's an esoteric bug somewhere in FileMaker itself or the file is corrupted. But if it's corrupted, then four other very similar fields, differing only in which other field they're referencing, are showing the exact same behavior, which seems unlikely But, you don't see any obvious error I've made? I'm not going crazy here, right? It works for me if the value is coming from a variable too. But when it's coming from that PRSN::c_seventh field, I get the discrepancy. I can't figure out why. And it's happening with four other fields as well. I mostly don't get how I can output a field's value, copy what that is, and then test for equality with it (PRSN::c_seventh = 5) and get 0. This is all coming from the data viewer's calc and results fields using copy and paste. c_seventh is an unstored calculation, so there's no index. It can't be indexed because it's referencing related data. It does use some custom functions I have, so I'm going to try unpacking those (none use recursion) and see if the problem persists.
  14. Can anyone explain how this calculation: List ( PRSN::c_seventh ; Length ( PRSN::c_seventh ) ; PRSN::c_seventh = 5 ; GetAsNumber ( PRSN::c_seventh ) = 5 ) is returning this result 5 1 0 0 The "PRSN::c_seventh" field is an unstored calculation that I've triple checked returns a Number. This arose from a more complicated calc that was returning the wrong value from a list. Let ( [ _levels = List ( "Very Low" ; "Low" ; "Moderately Low" ; "Moderate" ; "Moderately High" ; "High" ; "Very High" ) ] ; _levels & ¶ & ¶ & PRSN::c_seventh & ¶ & ¶ & GetValue ( _levels ; PRSN::c_seventh ) & ¶ & ¶ & GetValue ( _levels ; 5 ) ) is returning Very Low Low Moderately Low Moderate Moderately High High Very High 5 Moderate Moderately High
  15. In a system I built years ago, I register a ScriptMaster function with the following (obviously based on one of the ScriptMaster examples): RegisterGroovy( "PostDataToURL( key1 ; value1 ; key2 ; value2 ; key3 ; value3 ; key4 ; value4 ; url )"; "// Construct data¶ String data = URLEncoder.encode( key1, \"UTF-8\") + \"=\" + URLEncoder.encode(value1, \"UTF-8\" );¶ data += \"&\" + URLEncoder.encode( key2, \"UTF-8\") + \"=\" + URLEncoder.encode(value2, \"UTF-8\" );¶ data += \"&\" + URLEncoder.encode( key3, \"UTF-8\") + \"=\" + URLEncoder.encode(value3, \"UTF-8\" );¶ data += \"&\" + URLEncoder.encode( key4, \"UTF-8\") + \"=\" + URLEncoder.encode(value4, \"UTF-8\" );¶ ¶ // Send data¶ URL url_obj = new URL( url );¶ URLConnection conn = url_obj.openConnection();¶ conn.setDoOutput( true );¶ OutputStreamWriter wr = new OutputStreamWriter( conn.getOutputStream() );¶ wr.write( data );¶ wr.flush();¶ ¶ // Get the response¶ String response = conn.getInputStream().getText( \"utf-8\" );¶ wr.close();¶ return response;"; "isGui=false" ) The function is called with the following script step: Set Field [ POR__Main::xml_response ; Let( [ _ob = "AAA00000000"; _url = "http://connector.ob10.com/Suppliers/post.asp"; _key1 = "Contents"; _data1 = POR__Main::xml; _key2 = "OB10Number"; _data2 = _ob; _key3 = "Username"; _data3 = _ob; _key4 = "Password"; _data4 = "abc" ]; PostDataToURL( _key1; _data1; _key2; _data2; _key3; _data3; _key4; _data4; _url ) ) Starting yesterday, the script that executes the above step began giving an error. `SMLastError` returns `"java.net.SocketException: Connection reset"` while `SMLastStackTrace` returns the following: java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:168) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read1(BufferedInputStream.java:258) at java.io.BufferedInputStream.read(BufferedInputStream.java:317) at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:709) at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:652) at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:674) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1218) at sun.net.www.protocol.http.HttpURLConnection$getInputStream.call(Unknown Source) at Script1.run(Script1.groovy:16) at com.prosc.beanshell.GroovyFunction.invoke(GroovyFunction.java:125) at com.prosc.fmkit.Plugin.invokeFunction(Plugin.java:342) at com.prosc.fmkit.RegisterablePlugin.invokeFunction(RegisterablePlugin.java:146) at com.prosc.fmkit.Plugin.invokeFunctionNoErrors(Plugin.java:323) at com.prosc.fmkit.PluginBridge$4.run(PluginBridge.java:1289) at com.prosc.fmkit.PluginBridge.runTask(PluginBridge.java:1517) at com.prosc.fmkit.PluginBridge.doFunction(PluginBridge.java:1306) All of my checking indicates nothing has changed in the function or the script. We are waiting to hear back from the vendor we're connecting to in order to see if there's anything that changed on their end, but that seems unlikely. Why would this be happening and what can I do to resolve it? Thanks, Chuck
  • Create New...

Important Information

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