Popular Content

Showing most liked content since 01/28/2017 in all areas

  1. 2 likes
    One way to do it is with conditional formatting. Based on the results of a calculation, you can change the color of the text to match the layout background; or, you can change the size of the text to a very large number so that it's pushed outside the boundaries of the field or text box.
  2. 2 likes
    One could turn your argument around: suppose you are editing the script, and you want to make a change to the Set Field[] step; you would have to leave the script workspace and look for the calculation field in order to make the change there. I believe that if an action is scripted, it's good practice to place all the necessary logic within the script. And if you divide your scripts into logical parts and take care to comment each part, you should not have to look very hard in order to find what you're looking for.
  3. 1 like
    In all the given examples, you can populate AddressNumber as = LeftWords ( AddressOld ; 1 ) and AddressStreet as = RightWords ( AddressOld ; WordCount ( AddressOld ) - 1 )
  4. 1 like
    So why don't you do just that? Go to Portal Row [ Last ] Go to Portal Row [ Select; Previous ] Duplicate Record/Request Set Field [ Service::Service Date; Get ( CurrentDate ) ] This is assuming that: there are no other portals on the layout; the relationship is defined to allow creation of records in the Service table; the record you want to duplicate is shown in the last non-empty portal row. Note that if the Service Date field is defined to auto-enter the current date, you won't need the last step. --- Two unrelated notes: 1. As a general rule, you should avoid using copy/paste in your scripts, if only because it destroys the user's clipboard. 2. Your script reveals that you have numbered fields (Machine 1, Machine 2, Machine 3, etc.) fields in both tables. That's a symptom of poor structure. You should use multiple records in a related table.
  5. 1 like
    Author’s note: I’d like to offer a big thank you to Christian Schmitz of Monkeybread Software, not only for creating and continually improving a fantastic plug-in, but also for promptly and patiently answering my many questions. A few weeks ago we looked at creating a table of contents for a PDF containing nine individual reports. […] View the full article
  6. 1 like
    Another option is to place the objects inside a portal, and make sure that a related record exists or not, based on the selection. It's not quite clear what exactly your need is: do you want to show/hide the fields when printing, or during data entry, or ... ? Your mention of exporting is especially confusing, as that has nothing to do with what's shown on the layout. Anyway, script triggers play no role here - unless you are browsing records in Form view, and want the layout to change according to the loaded record's status. --- BTW, I would recommend you use 1/0 (or 1/empty) for Boolean fields, instead of YES/NO - see: http://fmforums.com/topic/47570-set-a-field-based-on-portal-content/#comment-222189
  7. 1 like
    I think the Hide When... functions only became available in FM Pro 13 After that you get into different layouts for for showing/hiding (blecch!)
  8. 1 like
    Performance issues aside (and I try to avoid unstored calcs if I can, I prefer my logic in scripts), there is another factor to consider. If part of the business logic changes and you are using unstored calcs then by changing the calc you risk changing all the historic records. Which can be a huge problem if you don't think through that ahead of time.
  9. 1 like
    +1 for comment's comments. As for a field definition being more easily accessible. Do you have any awareness of the risks of doing that? I suspect not; or you would not have made the statement. Though maybe you just don't have anybody using this system. What happens when you're defining a field while users are entering data? What can happen to the integrity of the file? You want users out of the system when doing this. Thus your timeslot for accessibility is extremely limited.
  10. 1 like
    I don't think so - but all performance questions are best answered by performing an actual test. Sometimes the results can be surprising. Performance aside, if you're going to use a script to populate a stored field with the aggregate value, then you don't need the unstored calculation field - and there is no good reason for the script to depend on its existence. Note that there may be additional factors to consider here, for example record locking.
  11. 1 like
    See also: https://community.filemaker.com/message/276855#276854
  12. 1 like
    Unstored calculation are evaluated as needed. If the field is not shown on the layout, and not referenced in any way, it will not be evaluated.
  13. 1 like
  14. 1 like
    Nothing wrong with multiple layouts so don't artificially limit yourself here. You need the layouts you need. Nothing more but also nothing less. And the layouts you use for scripting can just be blank layouts so there is virtually no maintenance on them. Absolutely agree. Security should be implemented at the data level first.
  15. 1 like
    Say that you have these records with 3 columns (car make and how many sold in what month): Chrysler March 100 Mazda February 50 Chrysler February 200 Honda January 90 Mazda January 40 If you want to show the totals per car make then you can use your subsummary by sorting the records by car make and defining a summary field for the total sales. But you can also loop through the records (physically or using GetNthRecord) or use another aggregating technique to load the data you need in a variable to loop through (HyperList has a very interesting readup on the pros and cons of all of them: http://www.modularfilemaker.org/module/hyperlist/) And as you go through your list you can keep track of 'buckets' with their totals, all in variables $sales[ code("chrysler")] would be the Chrysler bucket for instance, just keep track of the names of each bucket in a separate list, for every record, add the sales value to the sales bucket for that car make. Once you are done looping through your records / list, go to your scratch table and create one record for each bucket item (car make) and set the field to the what is in the $sales bucket for that car make.
  16. 1 like
    Not correct. There are two types of calculated fields: stored and unstored. Stored calcs get calculated when the record is created or when a dependent field is changed. They don't get calculated at the moment of download / caching. Unstored calcs & summary fields get calculated when they need to be used or displayed, basically when their value is referenced. That does not happen at the moment of download / caching between FM client and FMS. Having said that, calc fields are very often the root cause of a lot of performance problems in my experience. They are easy to use but consider them carefully. Use with caution.
  17. 1 like
    Whether hosted or local narrow tables are, imho, the way to go. Much faster for one thing.
  18. 1 like
    This thread seems to be stuck in a loop.
  19. 1 like
    There are a couple of issues with 0x00 it can not be inserted with Char( 0 ), Substitute ( fieldname; Char( 0 ) ; " _There was a 0x00 here_ " ) it can not be substituted by Char( 0 ) as in the example directly above, also tried pasting the 0x00 that looks like a line break in FileMaker into the script as follows Substitute ( fieldname; " " ; " _There was a 0x00 here_ " ) when copy pasted it sometimes become Char( 13 ) – 0x00 is untouchable in many ways. 0x00 is an invalid search criteria when copied from a field in browse mode and pasted into the same field in find mode In essence Char( 0 ) means end of string, it is fully capable on making its way into a FileMaker field, actually it probably is what terminates all FileMaker fields. It exports fine to FileMaker files. #include <stdio.h> int main () { char greeting[6] = {'H', 'e', 'l', 'l', 'o', '\0'}; printf("Greeting message: %s\n", greeting ); return 0; } After copy / pasting using the keyboard into the same field Char( 0 ) turns into Char( 13 ) [ Solved ] When Checking the box "Apply current layout's data formatting to exported data" for formatting the issue of 0x00 is no longer present for XML exports.
  20. 1 like
    Substitute ( fieldname; [ Char( 1 ) ; "&#1;" ] ; [ Char( 2 ) ; "&#2;" ] ; [ Char( 3 ) ; "&#3;" ] ; etc. ... )
  21. 1 like
    Use and MD5 checksum field. (Result is text)
  22. 1 like
    Answered via our support ticket, but for anybody else running into the same issue, the problem is probably that you're using JDBC (the default) instead of XML. JDBC is faster and generally more efficient, but to filter records with JDBC, you do it with a custom SQL qualifier in the same screen as the primary key pulldown menus. The MirrorSync customization script is totally ignored on the server when using JDBC (because JDBC cannot call scripts).
  23. 1 like
    Hi Lewis, Glad you got figured out and thanks for updating the thread with how you fixed it! Of note, the title at the top of the window having the "null" value is expected behavior for a new configuration. That null value will change to the name of the configuration once you complete it and go back and edit it.
  24. 1 like
    Obviously, you have a sub-optimal structure. You should have a separate record for each response (I am assuming that your records are actually the responses to the 12 questions, not the questions themselves - as could be understood from your description). So instead of having 24 fields x 1,200 records, you will have 2 fields x 14,400 records* - and producing the required report will become trivial. --- (*) More precisely, it will be 3 fields - because you have to add a QuestionID field.
  25. 1 like
    Keep in mind that you don't need to go with the FLT license, you can still use AVLA...
  26. 1 like
    Hi There The new FileMaker Licensing for Teams model is not really suitable for 'anonymous' logins via WebDirect since you have a fixed number of licenses. That licensing model is designed for teams who have a known number of members. The 'legacy' licensing model (previously known as AVLA or VLA) is not much better for your use-case, since you still have to stipulate a number of users. I would suggest that if you want to use FileMaker (and who wouldn't!) you could use custom web publishing & PHP to access and manipulate your data. It can be tricky to debug when you first start using it, but it is very straightforward so long as you have someone who can design the HTML for you. It does not rely on the number of licenses you have, and so long as your server is fast enough there is no practical limit on the number of simultaneous users. FileMaker 16 will bring new API access to your server data according to their roadmap, and I'm sure CWP using PHP will be deprecated at some point in the future, so you may want to wait for that version and see if it suits you better. You could call your local FileMaker sales team and run your scenario past them, as they sometimes have ideas on how to fit their license model to suit your needs. Hope that helps.
  27. 1 like
  28. 1 like
    It is context independent.
  29. 1 like
    The only way you will be able to present the user with a list that adds a value each month is to create all the possible values, from Jan 2016 to Dec 4000 (or some earlier month) in an auxiliary table, and use a ≤ relationship to show only records before or in the current month.
  30. 1 like
    See if this works for you: FieldNameAsParameter.fp7
  31. 1 like
    I would suggest you enter either: any date in the given month (which you can auto-correct to the first or last day of that month), and display it as MMM YY; or: the year and the month, in two separate fields. The value list that you asked about is problematic, because it looks like it needs to depend on the current date - but value lists need to be based on stored fields. The workaround is difficult and costly in terms of resources.
  32. 1 like
    See if the attached demo helps. It assumes you have imported the data into the three grey fields (f1, f2 and f3). The script finds which of the three fields has the "Color" label in the first record, and populates the blue Color field with the data from that field. RemapFields.fp7
  33. 1 like
    Well, if you load an image to memory, you may need to free it explicitly. Else more and more images will fill memory. At least for MBS Plugin, you need to call the free methods on each image to remove it from memory.
  34. 1 like
    Yes, we can, provided we have something - a field or a variable - that remembers the current state of "A". This is what I said earlier about separating between selecting and formatting: pressing the button needs to change the value of the field (or the variable); in turn, the color of the object is determined solely by the value of the field (or the variable), no matter how that value was established. As for the script itself, you don't even need a parameter. Let's say there will be 4 states, designated as 0, 1, 2 and 3 and a field named Status to hold the current state.. Have the script set the Status field to: Mod ( Status + 1 ; 4 ) and watch the field rotate among the values with each press of the button. Now, if you want to reuse the same script for other button/field/object combinations, then pass the field name as the parameter, and have the script do: Set Field By Name [ Get ( ScriptParameter ); Mod ( GetField ( Get ( ScriptParameter ) ) + 1 ; 4 ) ] Alternatively, you could forgo the script and just make each button perform a single-action Set Field step. The choice whether to use fields or variables depends on what's this really about: keep in mind that a variable is specific to the current user and expires at the end of the current session.
  35. 1 like
    If the string before the video ID is constant, you can simply substitute it with the new URL and append the filename to the result: Substitute ( URL ; "https://www.youtube.com/watch?v=" ; "http://img.youtube.com/vi/" ) & "/maxresdefault.jpg" Otherwise you can use: Right ( URL ; Length ( URL ) - Position ( URL ; "=" ; 1 ; 1 ) ) to extract the substring after "=" from the URL, and use it as: Let ( id = Right ( URL ; Length ( URL ) - Position ( URL ; "=" ; 1 ; 1 ) ) ; "http://img.youtube.com/vi/" & id & "/maxresdefault.jpg" ) to get the final result.
  36. 1 like
    Is the calculation storage option to "do not store calculation results -- recalculate when needed" checked? Making the calculation unstored should allow it to update automatically.
  37. 1 like
    I think it's a planned feature. I try to document layers by just adding a text block on the right far side of a layout (the offscreen section).
  38. 1 like
    That example does not look how you would use the BE plugin to make API calls... In FM it would look something like this; where $_json is the data that you want to send. You would have as many of the "set custom headers" as you need, their API will tell you what you need. This is assuming that the API requires an HTTP POST. If the API requires only HTTP GET then it would like different.
  39. 1 like
    FWIW, nothing in this list would take 5 minutes are less... so be a bit careful expressing things like this, you might not get the takers that you want.
  40. 1 like
    Security Vulnerabilities of FileMaker Platform API’s: An Update January 9th 2017 In an April 2016 entry on this BLOG titled The FileMaker Platform API’s Are Your Friends, Right? [http://fmforums.com/blogs/entry/1535-the-filemaker-platform-api’s-are-your-friends-right/] I discussed a number of FileMaker Platform security issues centered on the uncontrolled use of a number of external Application Program Interfaces (API’s). There are at least nine of these API, possibly more, if ExecuteSQL is included. The central thesis of that article was that these API’s provide unexpected attack vectors to compromise FileMaker Platform files. As noted at the time: Many FileMaker developers are not aware, however, that these API’s have the capability to access customer or client solutions in unexpected ways and to extract or insert data, to manipulate business processes developers embedded into these solutions, and to compromise the integrity of these solutions. Unfortunately, in the intervening nine-month time span, we continue to see cases where several of these API have been used for malicious purposes to compromise FileMaker Platform files’ business process integrity, to manipulate data, and to extract data. And many in the developer community remain unaware of this problem. In this BLOG entry, I will describe two of these API’s in greater specificity and detail, including describing a variety of attacks they can facilitate. This article will not discuss the ActiveX API that is available on Windows OS; however, developers should give similar attention to that approach. Developers need to be aware of these items in order to protect their files and those of their clients. The two API at the center of this focus are Apple Events and the FMPURL process. In the earlier article, I noted several elements about these that bear repeating here: [These API] cause particular concern because of their breadth and relative ease of use…. The Apple Events Suite has an extensive set of commands that can read and write data, read metadata, manipulate the UI, and trigger scripts. In addition, they can work outside the normal constraints found on layouts in a file. [http://thefmkb.com/5671] The FMPURL…can open a file and run a script in it. If the file is already open, then the script will still run. [http://thefmkb.com/5560] A few general comments about both of these API’s: · They are not platform-specific in the sense that just because a client organization is an all Windows OS environment that it is immune from an Apple Event attack. It’s the OS of the attacker that controls whether the API can be used. · There are some ways within Privilege Sets to constrain behavior of these API commands when they are applied on a file. The Export privilege bit can control the ability of Apple Events to extract data from a file. The Layout Access privilege bits can also constrain the ability to see contents of a layout. Likewise, Script Access privilege bits can control the availability of a script to either of these API. · These API often perform actions in unexpected fashions that fall outside the normal, traditional, and familiar FileMaker Pro User Interface behavior. This is part of what catches developers by surprise. —Apple Events— When a file is open, whether standalone or hosted by FileMaker Server, an attacker can send Apple Event commands to it causing it to perform a variety of actions, including: · Run any script to which the user has access, irrespective of whether that script is in the list of Scripts or whether it is attached to some UI element, such as a button. · Navigate to any Layout irrespective of whether that Layout’s name is in the list of Layouts or not. If the user’s Privilege Set has access to see that Layout, then its contents are visible whether the developer ever intended for the user to view the Layout or not. · Return various metadata about the file, including such items as Script Names, Value List Items, Layout Names, Field Names, etc. If a user’s Privilege Set does not allow access to the item, its name does not appear in the list returned. · Put data into any field in the database or extract data from any field, irrespective of whether that field is on the active Layout or is on any Layout for that matter. Here are several examples of these scripts, all working on a file named Our_Secret_Information.fmp12. tell application "FileMaker Pro Advanced" activate go to first layout end tell tell application "FileMaker Pro Advanced" activate do script FileMaker script "Relog_as_Admin" end tell tell application "FileMaker Pro Advanced" activate set somevar to name of every layout end tell tell application "FileMaker Pro Advanced" activate set somevar to name of every field end tell tell application "FileMaker Pro Advanced" activate set somevar to get data field "CreditCardNumber" end tell —FMPURL— The FMPURL command’s principal attack vector is that it can be used to run any Script in a file to which a user’s privileges has access. Similar to Apple Events, this occurs irrespective of whether that script is in the list of Scripts or whether it is attached to some UI element, such as a button. If the file is closed, the command first opens the file with supplied credentials, then runs any OnFirstWindowOpen script, and then runs the designated script from the FMPURL command. As a result of this behavior, a Halt Script step at the end of the opening script has the effect of blocking the running of the FMPURL designated script. Some developers have utilized this technique to block FMPURL calls to scripts in a file. However, if the file is already opened or if there is no opening script, then the designated script does run. Here is an example of calling a script, again in our file Our_Secret_Information.fmp12 being hosted at a server at IP address fmp:// Relog_as_Admin —What Is the Significance Of This and How Do We Address This?— One of the many reasons we caution developers against embedding security elements such as Identity and Access Management controls into the data layer of FileMaker Pro databases is precisely because such elements are vulnerable to these API attacks. Think for a minute about that Relog_as_Admin script that presumably relogs into the file with a [Full Access] Account. If an Attacker can trigger that script and cause it to run, irrespective of what the developer might have intended, then the Attacker has full access to the file. This has actually happened. Or, suppose that a developer has made a “Developer_Only” layout in the file, removed it from the list of layouts, and left sensitive information on it. If the Attacker can navigate to that layout, and if it is not protected by settings in the Privilege Set, then the Attacker can learn the contents of the information on it. This has actually happened in numerous instances, including unbelievably, the appearance of [Full Access] level credentials left exposed on the layout! Likewise, suppose that a developer has made a so-called “Privileges Table” with various fields that purport to control whether a user can do such things as create records. Using the Apple Event Set Data command, an Attacker could likely change the values in these fields if they do not enjoy additional protection. More likely even, the Attacker could simply issue a Make New Record command and create the record. That is a process frequently used to thwart developer-imposed limitations on the number of records in a demonstration version of a vertical market solution. So, what can be done to manage this situation and to prevent these type attacks? In FileMaker® Pro 15, FileMaker, Inc. added a new Extended Privilege option in the Privilege Set called fmscriptdisabled. Developers must explicitly invoke this option; it is not a default option. What it does is to prevent Apple Events (Macintosh OS) and ActiveX commands (Windows OS) from activating scripts, just as the name implies. It has no impact on FMPURL or on other Apple Event commands that do not involve triggering of scripts. Some of the other items in a Privilege Set, notably Export and data layer modification elements, can control Get Data and Set Data Apple Events. If Export is disabled, then Get Data will not return data from the selected field. In tables where the editing privileges are restricted, likewise, Set Data will not add data to a field. Creation and deletion privileges behave in similar fashion. Remember, we are talking here only about Apple Events. Other processes may behave differently. Controlling API behavior is important; however, it is not the only security feature that developers must invoke to assure Confidentiality, Availability, and Integrity of their database systems. So, clearly what we need here is a way to block these API from interacting with FileMaker Pro files. FileMaker, Inc. is aware of these issues and has been working on new ways to address them. In the Product Road Map Webinar presented on November 30th 2016, FileMaker, Inc. noted that the next version of the FileMaker Platform will contain a number of additional security enhancements. I am authorized to say that one of those enhancements will be a new process for more closely and granularly controlling several of these API’s. At such time as there is any new version of the FileMaker Platform, I will have additional comments and analyses of the issues related to these API’s.
  41. 1 like
    Another thing I am going to do is to make the field height so that, if there is more text than can show, only the top half of the text shows so Users know to scroll.
  42. 1 like
    IMHO, your assumption that having an IT department would have helped you here is unfounded.
  43. 1 like
    make sure to add /fmi/webd to the URL. What you are seeing is when you use the IP address or DNS name of the FMS machine but don't tell it to go to webdirect
  44. 1 like
    Jeremy's file is meant to be set as your desktop background and displayed at actual size NOT shrunk/stretched to fit. You can do better than that - create a new FileMaker file with a script that captures information about the available window space, then have your boss email that file back to you (or have it email you the data directly). Have a look at these functions, for some ideas of the types of data you can capture: Get(WindowContentHeight) Get(WindowDesktopHeight) Get(WindowHeight) Get(ScreenHeight) On Windows, some of these values can change based on the size of the Application window, or if the database window is maximized.
  45. 1 like
    I was having the same problem, and this is what worked for me: Some installations of Filemaker Pro 11 do not place a copy of server.pem in the C:Program FilesFileMakerFileMaker Pro 11 folder. The absence of this file makes it impossible to see any files hosted on a FileMaker Pro Server Advanced 11 server. Copying the file from a successful installation adds the needed functionality. This also works for copying server.pem from FileMaker Pro 7, and putting it into FileMaker Pro 11.
  46. 1 like
    Perhaps this might help. Note that this is not exactly a subject suitable for beginners. http://fmforums.com/forum/topic/61394-found-set/page__p__290372
  47. 1 like
    You can use portal filter to do "finds" on data once you have defined a basic relationship. You can also use the FIleMaker web viewer plus "collector scripts" to gather information and display it in tabular format in a web viewer. Look at some of the reports in the example file available here: http://www.filemaker.com/products/filemaker-pro/web_viewer.html
  48. 1 like
    I've sometimes found that putting the field on the layout as a Merge field helps. The GetRows() Custom Function has a somewhat unique syntax. Example: Let ( N = Count ( Invoice Line::Item_num ); GetRows ( "Invoice Line::Manufacturer ¶ Invoice Line::Item_num ¶ Invoice Line::Product Name"; N ; Tab ) ) You put return-separated fields AS TEXT into it. Because it wants the field names, not the values in the field. This means that those field names are hard-coded, so don't change the names afterwards. The Tab at the end is just a Custom Function where I pasted a real tab character into. This allowed me to use tabs in the calculation result to separate the fields. Looks like:
This leaderboard is set to Los Angeles/GMT-08:00