Aller au contenu

Soliant Consulting

Membres
  • Compteur de contenus

    119
  • Inscription

  • Dernière visite

    jamais

À propos de Soliant Consulting

  • Rang
    100

Profil général

  • Genre
    Non précisé

Profil FileMaker

  • Certification
    FileMaker 15 Certified Developer
  1. FileMaker 16 introduced a series of functions to work with JSON data. The primary motivation for adding this functionality was to make it easier to work with web services that transfer data in JSON. However, there are plenty of other good uses for JSON outside of interoperability with external systems. Some examples include passing and receiving script parameters and results. You can also assemble data (for example, for a report), which needs to be collected and/or transformed in some way but which does not otherwise need to be stored in fields. If you have data stored as JSON, presumably you will want to extract it at some point. And as part of doing that, you may end up assigning that data to variables, whether for better script readability or other reasons. Adding these assignment steps to your script can be tedious, especially when the JSON document contains a lot of data. For instance, given the following JSON document that has key-value pairs for each letter in the alphabet, we would end up having to create 26 "Set Variable" script steps. JSON example: { "A" : "value1" , "B" : "value2", … , "Z" : "value26" } Script steps: Set Variable [$a; Value:"value1"] Set Variable [$b; Value:"value2"] … Set Variable [$z; Value:"value26"] The following custom function will create these variables for you automatically: JSONCreateVarsFromKeys ( json ; namespace ) It will create local variables for all keys belonging to the JSON document's root node. Take Note You can leave the "namespace" parameter blank. If you specify a value, it is used as a prefix for the variables that get created. Typecasting is handled by determining the type for each value and then using functions like Quote, GetAsDate, GetAsTime, etc., to ensure the correct type. I took this portion of the code from the FileMaker Standards # custom function. My understanding is that Daniel Smith and Jeremy Bante wrote this code section, so the credit for this goes to them. (If you know otherwise, please let me know using the comments section below.) The variable names will be based on the keys that exist in the root JSON node, so this will only work if the key names follow the same naming restrictions as for FileMaker variables and fields. For instance, if a key name uses a reserved keyword such as AND or NOT, the custom function will return an error; specifically, error code 1204. Errors will be indicated in the custom function result using standard FileMaker error codes. 0 means no error. This function will return "?" when used in a pre-16 client. Below is the custom function code. /** * @SIGNATURE: * JSONCreateVarsFromKeys ( json ; namespace ) * * @PARAMETERS: * json - JSON data * namespace - Prefix for the variables that are to be created; can be left blank * * @HISTORY: * CREATED on 2017-12-08 by Mislav Kos <mkos@soliantconsulting.com> * * @PURPOSE: * Create local variables for all keys belonging to the JSON document's root node. * For example, given the following JSON, this custom function will create $id and $color variables: { "id" : "123", "color" : "blue" } * * @RESULT: * This custom function will return an error code as a result. * 0 means success or empty JSON. * 5 means invalid JSON. * 1204 means one of the JSON root keys did not conform to the FileMaker naming restrictions for variable and fields. * Pre-16 clients will return "?". * * @ERRORS: * Errors will be indicated in the custom function result using standard FileMaker error codes: https://fmhelp.filemaker.com/help/16/fmp/en/#page/FMP_Help%2Ferror-codes.html. * * @NOTES: * Keys must be named following the same naming restrictions as FileMaker variables and fields: https://fmhelp.filemaker.com/help/16/fmp/en/index.html#page/FMP_Help%2Fnaming-fields.html. * * @DEPENDENCIES: * Does not require any other custom functions. Requires v16 or later client. Pre-16 clients will return "?". */ Case ( IsEmpty ( json ) ; 0 ; // If JSON is empty, return 0 ("no error") Left ( JSONFormatElements ( json ) ; 1 ) = "?" ; 5 ; // If JSON is invalid, return 5 ("command is invalid") Let ( [ ~keys = JSONListKeys ( json ; "." ) ; // Get keys from JSON document's root node ~key = GetValue ( ~keys ; ValueCount ( ~keys ) ) // Process keys starting with the last one; otherwise JSON arrays won't process correctly ] ; If ( IsEmpty ( ~key ) ; 0 ; // If the JSON document's root node doesn't contain any keys, return 0 ("no error") // Create variable based on key, then delete key from JSON, and then recursively call CF again to process remaining keys Let ( [ // Get value for key ~value = JSONGetElement ( json ; ~key ) ; // Ensure correct typecasting of value; without this, everything would get typecast as text // This next section was taken from the the # custom function and (I think) was written by Daniel Smith (github.com/dansmith65) and Jeremy Bante (github.com/jbante) // See https://github.com/filemakerstandards/fmpstandards/blob/master/Functions/%23Name-Value/%23.fmfn ~plusOneText = GetAsText ( ~value + 1 ) ; ~isValidDate = not EvaluationError ( GetAsDate ( ~value ) ) ; ~isValidTime = not EvaluationError ( GetAsTime ( ~value ) ) ; ~number = GetAsNumber ( ~value ) ; ~value = Case ( ~value = "" or ~value = "?" or ~number = "?" ; Quote ( ~value ) ; ~isValidDate and ~isValidTime and GetAsText ( GetAsTimestamp ( ~value ) + 1 ) = ~plusOneText ; "GetAsTimestamp ( " & Quote ( ~value ) & " )" ; ~isValidTime and GetAsText ( GetAsTime ( ~value ) + 1 ) = ~plusOneText ; "GetAsTime ( " & Quote ( ~value ) & " )" ; ~isValidDate and GetAsText ( GetAsDate ( ~value ) + 1 ) = ~plusOneText ; "GetAsDate ( " & Quote ( ~value ) & " )" ; ~value ≠ ~number ; Quote ( ~value ) ; ~number ) ; // Create variable based on key and value (and namespace) ~error = EvaluationError ( Evaluate ( "Let ( $" & namespace & ~key & " = " & ~value & " ; \"\" ) " ) ) ] ; If ( ~error ≠ 0 ; ~error ; // If we encountered an error, return the error code and don't bother processing the rest of the keys Let ( json = JSONDeleteElement ( json ; ~key ) ; // Delete key from JSON JSONCreateVarsFromKeys ( json ; namespace ) // Recursively call custom function to process remaining keys ) ) ) ) ) ) Get the Demo File Download the demo file which provides several examples, including how to use the custom function to receive script parameters and results. References Creating JSON in FileMaker 16 Parsing JSON in FileMaker 16 FileMaker 16 JSON functions FileMaker 16 error codes Naming restrictions for FileMaker fields Naming restrictions for FileMaker variables # custom function from FileMaker Standards Need Help? If you have any questions on these instructions or the demo file, please let me know in a comment below. If you’re looking for help with customizing your FileMaker solution further, my team and I are happy to provide additional insights. Contact us today. The post How to Automatically Create Variables from JSON Data in FileMaker appeared first on Soliant Consulting. Voir le billet d'origine
  2. Create Variables from JSON Data in FileMaker Demo

    With the adoption of FileMaker 16 comes new functions to use JSON data, empowering you to do far more than just transfer data in JSON. By creating a custom function, you can take your FileMaker app further and use your data more effectively. Learn more about how to use a custom function like this to receive script parameters and results, by downloading your free demo. Read the blog post. Complete the form to receive the demo: Trouble with this form? Click here. The post Create Variables from JSON Data in FileMaker Demo appeared first on Soliant Consulting. Voir le billet d'origine
  3. AWS re:Invent 2017 Recap

    As you may know, one of our offerings, Soliant.cloud, is built on AWS (Amazon Web Services). We're constantly looking for new ways to learn more about the leader in IaaS (Infrastructure as a Service) and build on our positive experiences with the platform. My colleague, Bill Heizer, and I therefore attended the annual AWS conference, re:Invent, held in Las Vegas, Nevada. We're constantly looking for new ways to learn more about the leader in IaaS (Infrastructure as a Service) and build on our positive experiences with the platform There are several AWS conferences throughout the year, including one held in Chicago regularly attended by another colleague, Brian Engert. AWS re:Invent, however, is a larger event with more activities and session. Massive Turnout Attendance for re:Invent 2017 was around 43,000 people, and I believe conference organizers were originally anticipating significantly fewer attendees. To serve all extra registrants, they ended up adding several overflow sessions and repeat showings of some of the more popular sessions. Due to the turnout, the conference was spread out across the Vegas strip into four main venues. There were plenty of excellent sessions and activities to participate in. From keynotes and sessions to game day hackathons and hands-on labs to fitness challenges and broomball, it made for a full week. Click to view slideshow. A Wide Variety of Sessions Myself, I enjoyed the Compute focused sessions, primarily at the Venetian conference center. We also took in quite a few other value-added sessions, including business topics (very informative), security, advanced networking, serverless computing, IoT (Internet of Things), and machine learning. Next Time: Plan Ahead or Get White Castle’s Admittedly, our week started out a bit rough. Bill and I couldn’t attend our first session after waiting in line to get in. It filled up before we got a seat! However, our luck seemed to change after a trip to White Castle. They do not have White Castle in the part of the country Bill lives, so this was a rare and welcome treat. The trip marked a turn of fortune for us. After that, we seemed to have good luck all week getting into sessions. It may have been conference organizers working to accommodate the larger than anticipated crowd, but we attribute it to our White Castle visit. Keynote Sessions I enjoyed the Wednesday keynote by AWS CEO Andy Jassy and Thursday keynote by AWS CTO Werner Vogels. They were informative, highly-attended, and included several product announcements. New exciting features include GuardDuty, which records traffic and API logs, tracks regular behavior, and then alerts administrators about “irregular” behavior, therefore serving as a great security feature. Inter-region VPC peering, Fargate, and EKS (Amazon Elastic Container Service for Kubernetes) were also announced. Customer Success Stories And a conference wouldn’t be worth attending without quality entertainment and a handful of customer success stories. Lauryn Hill impressed the audience with her hit song "Everything is Everything." That is especially pertinent as the range of AWS offerings is immense and very broad. Companies like General Electric drove this point home as they shared how they use AWS to drive growth and efficiency. We also learned how educational institutions bid on spot price instance to lower costs and reduce time to complete massively complex calculations. AWS Within Soliant Consulting Offerings Bill and I gathered quite a bit of information to consistently to improve our FileMaker hosting services, Soliant.cloud. We continue to focus on providing the best experience possible for our customers and expand into new areas. We left with many insights to improve our hosting server and ideas to build on in the near future. My team and I will continue to provide a durable, reliable, and highly available service. Stay tuned to this space for new developments, as we continue to grow and build. Have questions about what we learned at AWS re:Invent 2017? Let us know in a comment below. The post AWS re:Invent 2017 Recap appeared first on Soliant Consulting. Voir le billet d'origine
  4. How to Build a Dynamic FileMaker Navigation Bar

    Wouldn't it be nice to have a button bar that you could place on every layout that handles basic FileMaker navigation and would automatically update itself when you make changes like rearranging, renaming, or adding layouts. The appeal of this functionality is that it can be applied to most any FileMaker solution. I’ve seen other approaches over time, although not all have met all requirements that I would want of such a tool. These requirements include: Works in Browse and Find mode Uses Themes and Styles Allows manually navigating to layouts Works in List View Works in Pro (both local and hosted), Go, and WebDirect Works with multiple windows Works natively (no plugins required) Does not require additional schema Handles a reasonable number of layouts Minimal scripts required Other nice-to-haves: Does not require custom functions, which is better for portability Retains the last visited sub-section, allowing for navigation of multiple tiers Image from: http://knowyourmeme.com/memes/expanding-brain This has been something that has been in the back of my mind for a long time. An earlier version I created used a web viewer to display navigation but only supported two tiers. That solution had its drawbacks, notably a "clicking" sound on Windows that happens when a web viewer is loading. That original version was done some 10-plus years ago and was due for an update using modern techniques. The newest iteration supports three tiers of navigation and uses only native FileMaker objects. You can also utilize Themes and Styles with current versions of FileMaker, allowing you to easily change the look and feel of your standardized navigation in all layouts that use the same theme. All layouts that use a common Theme will reflect updates across the entire file when you update the Theme. Three Tiers Deep This solution has three button bars, first introduced in FileMaker 14, that are stacked on top of one another. Your first tier is the top bar. Therefore, the minimum version of FileMaker for this technique is at least 14. Clicking on one of the top tier buttons takes you to the second tier and so on. If you think of the layout names as data, where we define a delimiter to separate the layouts, we can structure a naming convention that works with the navigation framework to build out the navigation scheme. Consider the following: Home Home__Dashboard Home__Reports Home__Reports__Additional Company Company__Details Company__Contacts__Info Company__Contacts__One Company__Contacts__Two Prefs This is a straightforward list of values, which is easy to understand. If we consider each individual value as having a list of its own, this could be considered a multi-dimensional array. For example, “Company__Contacts__Info” is a list with three values delimited with an underscore. In the above list, we have "Home", "Company" and "Prefs" on the first tier, and the second tier would be dynamic, based on the first tier we have selected. Company on the first tier has “Main,” “Details,” and Contacts” that appear on the second tier. Similarly, selecting “Contacts” on the second tier will show “Info” “One” and “Two” on the third tier. If there are no values to display on the second or third tier, that button bar is hidden. That also means it is easy to change your navigation by simply rearranging the order of layouts. The next time you run the “Load Nav” script, or just close and open the file again, your FileMaker navigation will update through your entire solution. Building the List Since we can get all the layout names with a Design function, it is possible to parse through those values to build a series of global variables that will display those values on a button bar. Once we determine which first-tier section we are on – based on the current layout name – we can evaluate which second and third tiers need to display. You may optionally set your own list of layout names to use, instead of using the design function. That gives you more control over naming layouts you do not want to appear, or layouts that may physically be out of order. If you want to keep it dynamic, there is a developer definable prefix to use that will omit layouts you do not want included. If you override with a static list, you can simply include only those layouts you wish to appear. This solution supports up to three tiers, with each tier being able to support up to ten values. That means 10 x 10 x 10 for a total of 1,000 layouts that can be maintained automatically. That should suffice for most of the solutions that I work on. Order is important Since we parse through the layouts to build the navigation interface, those layouts need to be in the order you want them to appear. This makes it trivial to update your user interface. Did you want "Prefs" to appear before "Company"? Then simply re-order your layouts and open the file again. Your UI will update to reflect the change. To populate all the needed variables, we need to run a script once when the file opens. In this version, all the buttons in the button bar get routed through a centralized “Nav” script, where exceptions can be handled. Alternatively, that script can simply use "Go to layout" by name. We also handle support for multiple windows in the “Nav” script if the user holds down a modifier key. The command key on OS X, the “ctrl” key on Windows, or the shift key will open a new window before navigating to the desired layout. Dynamically named variables The solution makes heavy use of dynamically named variables, so it may limit the characters used in layout names because they are used to name variables. If your layout names follow the naming convention explained above, it all just works. Global variables are all “namespaced” with a "NAV" prefix to avoid collisions with other variables you may set in your solution. BONUS FileMaker supports Unicode pretty much everywhere, so you can include emojis in layout names. They will display as icons in the navigation bars. Note: this also means you can have emojis in variable names. Under the Hood Button bars make it possible to use calculations to specify the active button segment. The calculations that determine which segment should be active for each of the three tiers are dependent on each other. For example, to know what the active segment should be for the second tier, we need to have already calculated the active segment for the first tier. So that we can more easily control which active segment is calculated first, the three active segments are determined using a single calculation, which has been placed in the top-most button bar. Layout objects are rendered left-to-right, top-to-bottom, so once the first-tier button bar evaluates its active segment calculation, the next two button bars will be ready to go. Second and third tiers with a null value are assigned a default value to display, like "Main." Buttons that are not used are hidden so that they cannot be clicked. The remaining space is filled in with invisible buttons that have no action assigned to them and act as filler, so the buttons stay at even width. If there are layouts you do not want automatically included in your navigation, you can exclude them by naming the layout beginning with "//". The notations used for the delimiter and exclude flag are configurable in the script that loads the navigation variables. If you want to use a different convention, you can change it to whatever you want, but the default is double underscore for tier delimiters and double slash to exclude the layout. Navigation scheme. This screenshot shows what the navigation scheme looks like. You can also see this in my accompanying demo file, which includes some sample layouts. The different tiers have been styled differently to set them apart. The next screenshot shows how navigation appears when viewing the "Company__Contacts__Info" layout. Navigation changes when on the Company layout. Because button bars are easy to manage, you can modify their placement and appearance easily. Would you rather display the third tier at the bottom of the layout? Just place the third button bar at the bottom of the layout. Layout size is wider than the sample file? Just resize the button bars to the desired width, setting the anchor points as needed. Save Your Place In each section, we can retain the last visited sub-section when navigating multiple tiers by setting the variables used to link to different layouts when navigating through the lower tiers. You would not want to keep having to navigate through 2nd and 3rd level tiers every time you go to “Company” for example. If you are drilled down, need to go to “Prefs” and go back to “Company,” you will arrive at the 2nd or 3rd tier you last visited. Multi-Window Support As we use global variables unapologetically, each window gets its own set of global variables to reference. These are set in the scripts and buttons, so there is nothing for you to update; it is all done for you. Is this a little heavy-handed, brute force setting so many variables? YES! But the work is done all up front and only once, so you can benefit from it in lots of places. Dynamic FileMaker Navigation Bar Instructions To use this in your own solution, follow these steps: Import the Theme, or create styles for the parts. This can be done later if you already have a Theme in use. Copy the "Load Nav" and “Nav ( layout )” scripts, paste it in your solution, and configure “Load Nav” to run when the file opens. Copy the navigation buttons bars and paste them into your layouts. Configure a script trigger to run when opening a new window (File->File Options…->Script triggers: OnWindowOpen) to include the “Load Nav” script. If you do this, you can disable the script steps to run this script when checking for a modifier key in the “Nav ( layout )” script. I will often use this technique on files that I have developed where I do not have time budgeted for layout navigation. With this solution, I have nice looking navigation available that can be implemented in a short amount of time. Try it yourself. Download the sample file. Need Help? If you have any questions about building your own dynamic FileMaker navigation functionality, please don’t hesitate to ask a question below or contact my team and me directly. The post How to Build a Dynamic FileMaker Navigation Bar appeared first on Soliant Consulting. Voir le billet d'origine
  5. What are Ghosts Sessions? When you lose your network connection or your FileMaker quits, sometimes your session doesn't drop off on the FileMaker server. This becomes a problem when that session hogs up one of your license spots. This doesn’t seem to happen often, but when I talked prentices to colleagues at the annual FileMaker Developer Conference, I learned it happens more often than we think. The Process to Eliminate Ghost Sessions So, once we identify we have a problem, we can start cooking up a solution. This particular server happens to be Windows Server. First I thought about VB scripting or Power Shell scripting. To be honest I've written one small Power Shell script, but this seemed a little above my head. So, I thought, well, here's a tool I know how to use: FileMaker. I wonder if it can do the job. It can, indeed. The process is basically the following: Issue a command in Command Line to get a list of connected clients; Create records in a table; Compare them to see which ones are the same (same IP address or user); Issue a disconnect for everyone except for the newest connection. So how do we do this from FileMaker? With the use of a plug-in, of course. In this case I grabbed the Base Elements plug-in, because it was already installed on the server. The Base Elements plug-in can issue Command Line commands. I use it to get the list of connected clients: BE_ExecuteSystemCommand ( "fmsadmin list clients -s -u <username>r -p <password>" ) The result comes back in fixed-width text format — which gave me a little headache, but I learned a lot from it. Fixed-width means that every word has a certain amount of space and the data is separated by an indeterminable number of spaces. To get that data into arrays, you have to calculate the position of the column headers. Let ( [ text = GetValue ( $BE_output ; 1 ) ; $$pID = Position ( text ; "Client ID" ; 1 ; 1 ); $$pUname = Position ( text ; "User Name" ; 1 ; 1 ) ; $$pCname = Position ( text ; "Computer Name" ; 1 ; 1 ) ; $$pCon = Position ( text ; "Connect Time" ; 1 ; 1 ) ; $$pDur = Position ( text ; "Duration" ; 1 ; 1 ) ]; $$pID & ¶ & $$pUname & ¶ & $$pCname & ¶ & $$pCon & ¶ & $$pDur ) I then go through the result and create records from it. Now I have records to compare the timestamp on the similar records. The way I do that is by setting up another table occurrence (user = user in my case) and then checking whether the record is a duplicate via this calculations: TimeStamp ≠ Max ( UT__UtilityTable_User::TimeStamp ) Here is my table: Utility Table (click image to enlarge) Disconnecting the Ghost Sessions The last thing is to find the records that are marked duplicate and then loop through to issue a disconnect command for them: # Loop through the dupes and disconnect Go to Record/Request/Page [ First ]
Set Variable [ $rep; Value:1 ]
Set Variable [ $maxReps; Value:Get (FoundCount) ] Loop #Disconnect the client(s) Set Variable [ $ID; Value:UT__UtilityTable::ID ]
Set Variable [ $command; Value:"fmsadmin disconnect client " & $ID & " -y " & " -u " & $username & " -p " & $password ] Set Variable [ $BE_output; Value:BE_ExecuteSystemCommand ( $command ) ]
Set Variable [ $error; Value:BE_GetLastError ]
If [ $error > 0 ] Send Mail [ Send yourself an email via SMTP so you know when there was a user disconnected.] [ No dialog ] End If Exit Loop If [ $rep = $maxReps ] Go to Record/Request/Page [ Next ] End Loop As you can see I'm using username and password variables above. Those are set in my script with the FileMaker Admin console access values I need to issue the command line commands. Following these steps should help you eliminate ghost sessions in FileMaker and avoid overusing unnecessary license spots. Good luck! If you have any questions, let me know in a comment below or contact my team directly. The post How to Disconnect Ghost FileMaker Sessions on Your Server appeared first on Soliant Consulting. Voir le billet d'origine
  6. As your knowledge of the techniques of FileMaker grows, so too must the depth of your knowledge on performing standard use cases in our custom apps. This thesis was my beginner session at FileMaker DevCon 2017. We can’t rely on one method that we like or are good at simply for those reasons; instead, we must choose the best way for the current circumstance of our custom app. Drawing on personal experience, I laid out a case for developers to have different ways to solve the same use case under their belts. I used the example of “Getting data from a found set” to illustrate my point. To illustrate my point, I demoed multiple methods to accomplish the following use cases: Creating a new record Editing a record Getting data from a found set These examples created great discussion on how to choose different methods and demonstration of some of them. The demo file, hosted at the FileMaker Community site, shows many other use cases and different methods you could choose for each. Please download an updated version from there, and take a look. I’m happy to answer any questions you have; just ask in a comment below. Soon, I’ll provide some more follow up videos and posts regarding the information presented in the session. Stay tuned to our blog page for those. This session presented the ideas and thoughts that I think through every day. We diligently and continually evaluate our techniques to see if they work for our current projects or if we should try something new. I hope you find it useful. Feel free to suggest other techniques to solve any of these use cases. Thank you Jeremy Watch the full session here: The post Build Your Skills to Tackle Familiar FileMaker Challenges in New Ways appeared first on Soliant Consulting. Voir le billet d'origine
  7. How to Use the ExecuteSQL Script Step in FileMaker

    When scripting in FileMaker I pay particular attention to the following: Code clarity: make sure your code is humanly readable; clean and documented; Reuse elements: declare a variable once, use it whenever you need it; Keep your code compact: if you don't need it, don't put it in or leave it in; Generate a sub-script if you have to use the same set of lines in multiple places; Speed: make it as fast as possible; and Error handling: make sure errors are caught and appropriately handled. You don't have to adhere to all of the above requirements, but your process will work better if you do. Recently I had a situation where speed was not sufficient for the process I was working on so I had to rethink the approach. The process involved populating a SQL table with data generated within a FileMaker app. If you work in environments with multiple software systems, you cannot escape having to exchange data with other databases, such as Oracle, SQL, or mySQL. FileMaker offers several features that allow for interacting with data in other sources. ESS uses the ODBC connection set up on your server (or desktop) to access supported external SQL sources as if they are a FileMaker table. The same ODBC data source can be used to execute commands. There are two ExecuteSQL features in FileMaker: one is a calculation function and the other a script step. ExecuteSQL Calculation Function If you haven't yet, I'd recommend getting familiar with the ExecuteSQL calculation simply because it just makes life a little simpler in FileMaker. I like to use it to get an ID of a certain record or simply get a record count for a set criteria. It's also useful for ExecuateSQL has become one of my favorite calculation functions. It's fast and gets the results done but it can only query the data source (SELECT). There are plug-ins out there that can perform other steps, such as INSERT. It can get sluggish if you use it on a dataset larger than 40,000 records. ExecuteSQL Script Step My user scenario was the following: we scan data at a facility into a database hosted using FileMaker Server. There are multiple users scanning date at the same time. The data needs to be posted to a SQL database in almost real-time, because they need to run reports on it in another system. Since we had issues on the client's SQL server (which we suspect might have something to do with the ESS tables being accessed all the time), we decided to try a different method. I set up a script to push the records into SQL via the ExecuteSQL script step executing the INSERT command. This was my initial approach to the new process: Search for the unprocessed records; Generate a field list variable; Generate a data list variable; Insert the current record’s data into SQL; and Loop to repeat steps 2 - 4 for each record in the found set. Throughout the process I learned that I needed to issue a command before inserting a record: SET IDENTITY_INSERT [ database_name . [ schema_name ] . ] table { ON | OFF } This command can be combined with the INSERT lines, which makes it simpler. This script got the job done, but it would take five minutes to process fewer than 1,500 records. Since they wanted to run the script every five minutes the script would bite its own tail. I started tinvestigating to see if there’s a way I can cut the time down. Turns out you can INSERT multiple rows into SQL with one command, as many as 1000 records at a time. I refactored my script once more to post records in a batch. Along the way, I also learned that FileMaker Server does not suppress the 401 error, so I modified my process — see the reference above. This is the new process: Check for unprocessed record with ExecuteSQL calc; If they exist, search for the unprocessed records; Generate a field list variable; Loop through up to 1000 records to generate the data list variable; Push data to SQL; and Continue looping until all the records in the found set have been processed, Now steps-wise this doesn't look like a huge change, but the script time got reduced from about five minutes to four seconds. Below is the set of SQL commands I used to insert 1,000 rows into SQL at the same time. The Command "SET IDENTITY_INSERT [dbo].[SCN__Scan] on " & ¶ & "INSERT INTO SCN__Scan (" & $_fieldset_horizontal & ") VALUES " & $$_data & ¶ & " SET IDENTITY_INSERT [dbo].[SCN__Scan] off" The Field Set The $_fieldset_horizontal variable is just a comma-separated list gathering the names of the fields on a layout using the function FieldNames ( Get (FileName) ; Get (LayoutName ) ). So once you gathered your fields, you need to replace your carriage returns with commas: Substitute ( $_fieldset ; ¶ ; ", " ). The Data The $$_data variable is also a comma-separated list of values with prentices surrounding each record; it essentially looks like this: (value1, value2, value3), (value1, value2, value3), (value1, value2, value3), etc. Error Checking You cannot program without debugging. You can get error reporting from the Get ( LastExternalErrorDetail ) function after each execution of the ExecuteSQL script step. It's very detailed (much more so than the error reporting on the ExecuteSQL calculation function) so you can correct errors as they occur. Testing When you are testing you generally need test data. I assembled a quick script that generates 1,500 records with Perform Script on Server (PSOS) script step, but first truncates the table. Since I have access to the client's SQL data source, I can also truncate the SQL table. Wash, rinse, repeat. Running It from a Server It's always another can of worms when you run a PSOS or scheduled server script. Two things that come to the rescue are logging any and all errors and logging script execution times. I set up an ErrorLog and a ScriptLog table in my solution and log the results. Happy FileMaking! The post How to Use the ExecuteSQL Script Step in FileMaker appeared first on Soliant Consulting. Voir le billet d'origine
  8. Best Practices for FileMaker Web Viewer Integrations

    A year ago, I knew very little about the web viewer and how to use it in a FileMaker custom app. I could use the presets, of course, but couldn’t adapt it to my own needs. My, how much has changed in one year. Through careful study that took many hours, I finally came to some understanding of how to integrate languages of the web (HTML, CSS, JavaScript) into a custom app to provide deeper functionality. As a result of that hard work, I was lucky enough to be able to share my experience and offer some advice at FileMaker DevCon 2017 on this very subject, and I’m grateful for the opportunity. This hour-long session barely scratched the surface of the lessons I’ve learned over the last year. I could have gone for two or more hours on these insights I have to share. In an effort to give DevCon attendees the information I find most important, I focused my session on the best practices of integrating a JavaScript library into FileMaker, showcasing my guides through the lens of real-life examples. Web Viewer Library-FileMaker Integration Best Practices These best practices include: Placing all web-language code into fields; Using one field for each of the files a library requires; In the main field, called HTML in my library, putting in placeholders, such as “**CSS**” that will be eventually substituted out for the code in another field; and Using the fmp protocol to call back to FileMaker and perform some action on the data. I illuminated these best practices and ideas through a few examples of the web viewer library, a collection of 35 (and growing) integrations. I also reviewed how to manipulate an integration and finally, how to push it to any custom app. Does an Integration Make Sense for Your Custom App? Throughout the discussion, I emphasized a key point: always make sure an integration is the best method for your custom app. They look pretty and can deepen FileMaker’s functionality, but the end solution may not always be worth your development efforts. I tried to set up my library to make it very easy to implement one of these, but if you don’t know JavaScript that well, your productivity can be less than desired. The session gave us a chance to skim the surface of this amazing possibility. If you were unable to make it, FileMaker is sharing the entire session here in a video. I hope that you found (or find) the hour engaging and informative and most of all, inspiring. In the coming months, I’ll be putting together short videos explaining many of the integrations in depth. Stay tuned to our blog page for those, and of course, follow me on twitter, @jlbmagic, where I’ll highlight all that I’ve learned and have put together. Watch the full session here: The post Best Practices for FileMaker Web Viewer Integrations appeared first on Soliant Consulting. Voir le billet d'origine
  9. FileMaker Software as a Service (SaaS)

    FileMaker Pro is well-known as a desktop application and is making great strides in expanding its market in mobile and web with FileMaker Go and WebDirect. Traditionally, it has been viewed as a Rapid Application Development (RAD) platform for use in On-Premises deployments. However, that view is changing. I found this unattributed image online and thought it fit with my team’s services. I really like the succinct way of explaining these different concepts. I’d like to expand on the ideas presented in this visual. On-Prem FileMaker On-Prem refers to a locally hosted server in an office setup, on which users can access the locally hosted application server. Having a local, easily-developed application has many advantages if your users access it at the office and you can architect your networking to provide outside access. This strategy has served as the old standby for years, especially when internet costs were much higher 10+ years ago. As the landscape has continued to evolve with agile flex space allowing companies to remain competitive, FileMaker has also expanded with continual network improvement and different access methods. FileMaker Infrastructure as a Service (IaaS) With options such as Amazon Web Services (AWS) providing a pay-for-what-you-use infrastructure on demand, FileMaker can play an important part of your company’s growing cloud strategy. Of course, you still have the consideration of configuring and developing your solutions, just like you would have when hosting on premises. FileMaker Platform as a Service (PaaS) If you adopt hosting services like Soliant.cloud or FileMaker Cloud, you essentially have Platform as a Service. PaaS serves up all the FileMaker goodness and removes infrastructure concerns. You no longer need to configure or provision machines to host your solutions and can instead concentrate on solution development. FileMaker Software as a Service (SaaS) Finally, by combining professional development services with our Soliant.cloud FileMaker hosting services, you effectively have your very own custom Software as a Service. Plus, you have a few extra perks -- normally with SaaS, you have limited options in customization, but with FileMaker, you can tailor your solution to fit your exact business needs. Soliant Consulting + Soliant.cloud = SaaS For more information about transforming your FileMaker solution into a truly custom application for your business, contact my team and I today. The post FileMaker Software as a Service (SaaS) appeared first on Soliant Consulting. Voir le billet d'origine
  10. Demystifying SSL

    Secure Sockets Layer (SSL) is a critical part of security, but many FileMaker developers don't know much about it. We all use it, probably every day, but most of us have not had to set it up or really understand how it actually works. Maybe we think of it as some sort of voodoo that happens behind the scene, and as a user, that's fine; there's no need to understand it any more than that. But as a developer or a server administrator who has to set it up, it can be helpful to know a bit more about how it works. I’ve invested some time learning about SSL and even presented a session at the 2017 FileMaker DevCon called "Demystifying SSL." What is an SSL Certificate? Let’s take a closer look at how SSL works. When you set up SSL, you have to get this thing called a certificate. If you're new at this, you may have the following questions: What is a certificate? What is being certified? What is contained inside the certified? Why do I have to pay some other company (with this funny name "certificate authority") to give me one of these? Why can't I just use the standard certificate that comes by default when you install FileMaker Server? If you’ve never set up SSL before, I’m sure you’ll have at least a few of the above questions. If you’re considering using SSL, the somewhat convoluted setup process may scare you off. In fact, unless there is a very explicit demand or requirement that SSL is used, you may decide not to even bother with it. The process of getting the certificate and the process of installing it might just seem too involved to be worth it. And I bet many developers have made such a decision for these reasons, and they're able to get away with it, because, well, if you don't use SSL, all of the functionality is still there. Everything still seems to work just fine. Why You Need to Use SSL With FileMaker So, if that’s true, why do we bother with SSL? I answer this question in some detail in my session, but in short, we use SSL to prevent eavesdropping, data tampering, and impersonation. The security principles underlying these three objectives are called confidentiality, integrity, and authenticity. DevCon Session Overview The goal of my DevCon session was to demystify the whole thing – to break it down into parts, explain each of the constituent parts, and share why each step of the process is necessary. The session covered the following topics: General SSL background Why use SSL: objectives and security principles Difference between encryption and encoding Symmetric and asymmetric encryption methods and the key distribution problem Message authentication codes (MAC) SSL certificates: what is being certified, what is inside a certificate, what is a certificate authority, and how digital signatures work Chain of trust, root certificates, and root certificate stores SSL handshake Certificate validation methods: domain (DV), organization (OV), extended (EV) Certificate types: single domain, multi-domain, and wildcard Getting and installing an SSL certificate for FileMaker Server and FileMaker Cloud Certificate signing requests (CSR) Certificate authority landscape Proving domain control: email challenge response, file lookup over HTTP, DNS lookup Installing the certificate and testing Alternate scenarios: multiple servers Making changes to a certificate Patching SSL Review question: Why should the standard FileMaker Server certificate not be used in production? Watch the Video You can watch a recording of the session and get a copy of the accompanying slides. Have Questions on Implementing SSL? My team and I are happy to answer any other questions you have about how to use SSL with your FileMaker solution. You can either ask in a comment below or contact us directly. The post Demystifying SSL appeared first on Soliant Consulting. Voir le billet d'origine
  11. How to Use AWS in FileMaker with AppStream 2.0

    In this video, Mike Duncan shows how you can leverage Amazon Web Services' infrastructure in your FileMaker deployments by using Amazon AppStream 2.0. Read his blog post on the topic. The post How to Use AWS in FileMaker with AppStream 2.0 appeared first on Soliant Consulting. Voir le billet d'origine
  12. FileMaker, AWS, and Amazon AppStream 2.0

    Were you able to catch my DevCon 2017 session on FileMaker and AWS: What You Need to Know? I used the opportunity to show how to spin up a FileMaker Server with Amazon Web Services (AWS) and discussed relevant services and concepts. If you couldn't make the annual developer conference, you can watch my session in its entirety here. Toward the end of the session, I demonstrated an AWS service called AppStream 2.0, which offers a fully functional FileMaker Pro experience using nothing more than an HTML 5 web browser. Get a full explanation here: In this demonstration, we access a solution on Soliant Consulting's FileMaker hosting service, Soliant.cloud, in AWS. There is very low latency, because all network traffic from FileMaker Pro to FileMaker Server is essentially on the same local network. Amazon AppStream 2.0 With Amazon AppStream 2.0, you only pay for the time that sessions are active, and they can be configured to auto scale on demand. When users connect, more sessions are created. When they log out, the sessions end, and you save on cost. Elasticity is a huge benefit with AWS cloud computing. AppStream also supports federated logins from other sites, including SAML or Security Assertion Markup Language. While FileMaker on its own does not support SAML, it is found more readily in enterprise-level companies for authenticating users to several services from one authority. From there, it is possible to have the Windows image used by AppStream configured to use SSO (Single Sign On) and log you straight into your FileMaker solution. Security Configuration You can also configure security to only allow access from cloud hosted subnets, and not open your FileMaker Server to the world. You can configure to allow access from your "on premises" corporate location, as well as secure, cloud based clients such as AWS Workspace or AppStream 2.0. Below is a sample scenario we showed during the session. Sample scenario shown during my "FileMaker and AWS: What You Need to Know" session at DevCon 2017 Of course, this is just one sample scenario and could be built out to your exact needs. All of this demonstrates how the FileMaker platform can indeed be a good fit for an enterprise, a point FileMaker highlighted during the DevCon Keynote address - a sizable amount of its business is from the enterprise market. Of course, you could have this built to your exact specifications, or use the hosting we provide, Soliant.cloud to get started today with FileMaker and AWS. Next Steps If you have any questions about FileMaker and AWS or want to learn more about Soliant.cloud, please let me know in a comment below. You can also contact my team and me directly here. The post FileMaker, AWS, and Amazon AppStream 2.0 appeared first on Soliant Consulting. Afficher la totalité du billet
  13. FileMaker's Devcon is always a special time of the year - an opportunity to learn and meet old friends, make new ones, and share information. And this year's Devcon was extra special: record attendance! FileMaker Inc. has just released the first batch of video recordings of the Devcon sessions. I'm happy to see my presentation on the FileMaker External Authentication options of EA, SSO, AD, OD, OAuth, and LDAP, included in this selection. If you want to see what the FileMaker 16 platform brings in terms of new OAuth external authentication you are in the right spot. As always, feel free to follow up with questions, here or on the FileMaker forums. You can watch this directly on YouTube here. The post FileMaker 16 OAuth External Authentication: An Exploration of Your Options appeared first on Soliant Consulting. Afficher la totalité du billet
  14. Chicago, Ill. – August 21, 2017 – Soliant Consulting was honored by earning the FileMaker Excellence in Education award at the platform's annual developer conference. The FileMaker Excellence awards recognize outstanding companies for development, design, innovation, education, and advocacy on the platform. Individuals and international partners are also recognized at the annual summer event. Soliant Consulting was recognized as a leader in FileMaker education for its dedication to helping others learn and succeed on the platform. This includes the firm’s contributions to FileMaker’s recently-launched free video tutorials. Soliant Consulting developers also frequently contribute to the FileMaker community forums, offering insights, step-by-step solutions, and feedback on processes. The firm also regularly shares content on its website to help both developers and users learn more about the platform, including blog posts, downloadable demos, and video tutorials. "Training and education have always been an integral part of our team culture, and I'm very proud of the contributions our team makes to the FileMaker community," shared Bob Bowers, Soliant Consulting CEO. "We're looking forward to continuing to help others learn more about the platform and build great solutions." This is the most recent of Soliant Consulting’s distinctions at the platform’s annual developer conference. In 2015, Senior Technical Architect, Wim Decorte, was recognized as FileMaker’s Leader of the Year award for his involvement in the community, forums, and conferences around the world. Soliant Consulting also earned FileMaker Excellence Awards in 2008 and again 2012 for Partner of the Year. Soliant Consulting CEO, Bob Bowers, has also earned numerous recognitions for leadership and developing technical resources for the FileMaker community over the last two decades. Soliant Consulting looks forward to continuing to help FileMaker developers and users learn more about the platform and build strategic solutions for the community. Learn more about Soliant Consulting’s dedication to education on the platform here. Watch the free video tutorials Soliant Consulting’s FileMaker team worked on here. See other award winners from FileMaker’s Developer conference in Phoenix, AZ in July 2017 here. The post Soliant Consulting Honored for Excellence in Education at Annual FileMaker Developer Conference appeared first on Soliant Consulting. Afficher la totalité du billet
  15. How Scripts Think in FileMaker

    Fourteen years ago, I attended my first DevCon in Phoenix, and it was a pleasure to return this summer and recall old times (or young times, as it were). I learned a lot, caught up with longtime friends, and even had the opportunity to present a session myself called "How Scripts Think." View my entire session on YouTube here. My topic was decision-making in FileMaker scripts: the fundamental concepts of script logic and a strategy for outlining decisions in your own scripts. Here's what I covered: Learning the basics: logical script steps, functions, and variables Creating workflow diagrams Outlining your script using comments Building your logical structure Filling in your actions Testing your script with the Script Debugger and Data Viewer I put together a demo file that illustrates my process for building logical scripts, including some examples I didn’t have time to present as well as several templates for key logical structures. That file is available in the FileMaker Community here. It's one of my favorite challenges to put together clear and approachable training materials that use concrete, everyday examples to introduce abstract concepts. I was especially excited about my central example this year: following a recipe to make chocolate-chip cookies. Since I try to create as many of my own presentation images as possible, that meant conducting a big photo shoot in my kitchen while baking a bunch of cookies. And then eating them one after another, compulsively, as I sat at my desk working hard on this talk. I hope you'll take the time to view the video and let me know whether my examples made sense to you, or if they just left you feeling hungry. And perhaps you can advise me: the next time I give a session, should I switch to leafy greens -- or cheesecake? View the session video here. Download the example file here. The post How Scripts Think in FileMaker appeared first on Soliant Consulting. Afficher la totalité du billet
×