Jump to content

Chuck

Members
  • Content Count

    1,028
  • Joined

  • Last visited

  • Days Won

    3

Chuck last won the day on November 27 2018

Chuck had the most liked content!

Community Reputation

5 Neutral

About Chuck

  • Rank
    member
  • Birthday 06/16/1971

Profile Information

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

Contact Methods

  • Website URL
    http://chivalrysoftware.com/index.php/blog
  • Skype
    chivalrysoft

FileMaker Experience

  • Skill Level
    Expert
  • FM Application
    17

Platform Environment

  • OS Platform
    Mac
  • OS Version
    High Sierra

FileMaker Partner

  • Certification
    7
    8
    9

Recent Profile Visitors

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

  1. 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.
  2. 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?
  3. 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`.
  4. 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?
  5. 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.
  6. 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.
  7. 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?
  8. 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.
  9. 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.
  10. 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.
  11. 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.
  12. 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
  13. 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
  14. I'm looking for information about a FileMaker plugin called "PyPlugin." I have a client with an existing system who has it installed on macOS, but I can't find any information or documentation about it. Given the name, I assume it allows the execution of Python within FileMaker, but this isn't PyFM or PyFileMaker, since first, it's working on a Mac, and second, it's a plugin, not a Python library. The system has been used for quite some time, so perhaps the plugin isn't available any more, but if anyone can point to any documentation for it, or, of course preferably, a link to be able to download it, I would appreciate it. Thanks, Chuck
  15. I have found the 24U plugin template to be quite useful in porting a plugin that was originally built for Windows, but one issue I've come across is that the function IDs need to match the existing Windows version instead of working sequentially. In an attempt to make this happen, I added a `#define` for each of the plugin functions in FMTConfig.h, such as: #define FUNCTION_1_ID 15007 Then I changed the lines in FMTemplate.cpp to read like this: err = RegisterExternalFunction( FUNCTION_1_ID, FUNCTION_1_PARAMS, regFunction1Flags, FUNCTION_1_C_NAME ); ... UnRegisterExternalFunction( FUNCTION_1_ID ); .... (void) fmx::ExprEnv::UnRegisterExternalFunction(*pluginID, FUNCTION_26_ID ); One function, the second one, retains the default ID, so it reads #define FUNCTION_2_ID 2 Anyone familiar with the template has probably already guessed what has happened. That second function is the only one that is useable in FileMaker. The rest of the functions have blank lines in the function list of the calculation dialog box. I think this is related to the myplc.c and 24u_plist_compiler.sh files, but can't quite figure out what needs to be changed. I *think* I might need to edit FMTemplate.plc, but that doesn't seem right, since it hasn't been edited to this point and only includes the strings generation code for the first 10 functions (there are 26 functions at this point). Just to try it out, I attempted to directly edit the strings file after the plugin was built, but this didn't help, or more properly, I wasn't sure what edits to make. So, if I *need* to have my first function have a function ID of 15007 instead of 1, what else do I need to change? Thanks, Chuck
×
×
  • Create New...

Important Information

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