Jump to content

HazMatt

Members
  • Posts

    251
  • Joined

  • Last visited

About HazMatt

  • Birthday 07/28/1979

Profile Information

  • Gender
    Male
  • Location
    Minnesota, USA

Contact Methods

  • Website URL
    http://www.cimbura.com

Recent Profile Visitors

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

HazMatt's Achievements

Community Regular

Community Regular (8/14)

  • First Post
  • Collaborator
  • Conversation Starter
  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. BaseElements has an "Overview" layout that has a nice list of element counts. There are columns for Count, Errors, Unreferenced, Warnings and Performance. Errors are in red. A report card containing raw data of that kind (and perhaps a few subjective grades) would be very helpful to get a quick idea of potential issues.
  2. I really don't mind, but I just rarely visit the forums these days, so it would likely be out of date next time I post something.
  3. Fascinating… glad I'm not crazy or [too] stupid! I figured out a more "pure" way to accomplish my goal, one that would work no matter what the order of the tests was in: Let( [ d = Self ]; IsEmpty(d) or IsValid(GetAsDate(d)) or (d = Filter(d; "0123456789") and Length(d) = 4) ) For the record, I agree… sort of. A field named "Birthdate" should be a legitimate, valid date. But there are trade-offs to the suggested approach… 4 fields instead of 1 make for a wider table and a more complicated user interface that precludes the use of the drop-down calendar and possibly acrobatics to simulate a single field when there are three. Do I have to?
  4. Use-case: Full birthdate is not known… only the year. Better to have a valid 4 digit year OR a full, valid date than whatever the user feels like entering. The field is Contacts::Birthdate (Text). Field validation by calc is turned on with this code: Let( [ d = Self ]; IsEmpty(d) or d = GetAsDate(d) or (d = Filter(d; "0123456789") and Length(d) = 4) ) If I enter nothing in Birthdate, it is accepted. If I enter "4/25/2016" in Birthdate, it is accepted. If i enter "2016" in Birthdate, it is rejected as not meeting field validation requirements. BUT, if I run the code below in Data Viewer, it evaluates as true (or "1"): Let( [ d = "2016" ]; IsEmpty(d) or d = GetAsDate(d) or (d = Filter(d; "0123456789") and Length(d) = 4) ) The problem seems to revolve around the Filter() function, but enclosing d in GetAsText() or GetAsNumber() does not help. Can anyone tell me why I am getting different logical results between my Data Viewer and the field validation?
  5. comment, you're a genius. Copying and pasting "¶" (where the ¶ is the invisible character, of course) does work manually, and your suggestion to use a script got me thinking… So, here's my script: Script Name: Find All Records with "¶" In Current Field # If [IsEmpty(Get(ActiveFieldName))] # Cursor not in any field Beep Show Custom Dialog [Get(ScriptName); "Please place your cursor in an active text field and try again."] Exit Script [] End If # # Attempt the find Enter Find Mode [] Set Field By Name [Get(ActiveFieldTableName) & "::" & Get(ActiveFieldName); ""¶""] Set Error Capture [On] Perform Find [] # Include this script in the menu, and now all I have to do is hit Command-6 (in my case) to immediately get what I want. Perfect!
  6. I'd like to verify that a number of fields do not have any carriage returns (¶) in them. I already have an auto-enter calculation that I am adding to each field to prevent this from happening in the future. One solution is to create a secondary calc field that will return "1" if a carriage return is detected in 'FieldName': PatternCount(FieldName; "¶") > 0 If I search for "1" in this secondary field it works great (and I can fix individually or quickly via Replace Field Contents), but changing the calculation is tedious to do for a large number of fields. Is there instead a way I can enter Find Mode and enter something directly in the field I'm interested in fixing up? I've tried the following, but no records are found: ¶ "¶" ¶ Char(13) *"¶" dat pilcrow
  7. Ahh, advanced SQL coding techniques… Probably beyond my ability (and time) at this point. I just updated my skill level in my profile to "Expert" but I think you are ahead of me.
  8. Yep, I know. Just surprised, is all. Yes, the "gaps" I speak of are null values. Average() automatically ignores blanks, so it would have been nice to use it. eos and comment, I spent the time since my original post to try and figure out an alternative, and I came up with a similar method, although it looks like your script steps are probably more error proof. Here's my custom function, GetAverage(Values): /* Purpose Calculates the average of a list of values. Useful for when the Average() function does not work. With inspiration from: • Debi Fuchs' "CullNulls" (http://www.briandunning.com/cf/897) custom function • Tom Fitch's "ListSum" (http://www.briandunning.com/cf/1309) custom function History 2014/10/10 - Matt Larson (Cimbura.com) - Custom function creation */ Let( [ str = "#||#*howdy*#||#"; // Unique string used to strip out null values v = Substitute(str & Values & str; ["¶¶"; ¶ & str & ¶]; ["¶¶"; ¶ & str & ¶]; [str & ¶; ""]; [¶ & str; ""]; [str; ""]); // Strip out unwanted carriage returns v = Substitute(v; "¶"; ";") // Convert carriage returns to semicolons for use in Average() function ]; Evaluate("Average(" & v & ")") ) I was pretty vague with "bunch of numbers", wasn't I? Sorry. They are actually the results of an ExecuteSQL script step, so I wanted to avoid having to needlessly navigate to a different layout, set up additional summary fields, etc. Thanks a lot guys.
  9. I am writing a script where I need to calculate the average of a bunch of numbers. There may be 1 number (where no averaging is calculated) or up to 10 or so. There may be gaps in the numbers from time to time as well. Set Variable [$CalculatedAvg; Value:Average($ListOfValues)] Doesn't work—no variable is created. Can anyone suggest something that could work? I was hoping to use the Average function because it automatically accounts for blank values. Not looking forward to having to eliminate blank values, adding up the remaining values and dividing by ValueCount(). Perhaps virtual list with an average summary field? I guess I'm just surprised some of these aggregate functions don't work on a list of values in a variable. I ran some tests in the Data Viewer, and this is the error message I get:
  10. Yeah, seems like a hack no matter which way you 'slice' it, eh? Thanks for pointing out the record #1 load issue—I do have this in my script: Get(RecordNumber) = 1 #WebDirect always loads record #1 regardless of record number specified Exit Script [] End If
  11. I might just do that. Thanks for the suggestion. Being the "IT Guy" I certainly have admin access to all the machines.
  12. I agree that the inability to pass custom parameters upon launching a WebDirect solution is needed! I am working on replacing our broken PHP job application form with WebDirect and here's what I'm doing, which might work for you if you do not need to pass dynamic parameters: 1) Create a table "webdirect_solutions" and create a couple of records. 2) In the second record, enter a value "New Job Application" in the Action field. (this will be the static script parameter) 3) Create a layout "lyt_WebDirect_Landing_Page" and add a script trigger for OnRecordLoad, which passes the value of the Action field. 4) Create the trigger script, "Launch WebDirect Solution Action" that takes the passed script parameter and goes to a different layout, or whatever you want. So, your URL would look something like this: http://<IP address>:<Port number>/fmi/webd#<database name>&lay=lyt_WebDirect_Landing_Page&viewstyle=form&record=2&mode=browse Basically, you could set up an unlimited number of static parameters (or "actions" as I call them) stored in those records, which allows you to change only the record number in the URL that launches the WebDirect solution. This approach has some drawbacks: • Deleting a 'solution' record will bump the remaining solution record numbers down, so any stored URLs would have to be updated to suit. • Only values that you specify in each 'solution' record can be passed. No dynamic values. • Maybe other drawbacks I haven't thought of… I'm only getting started with WebDirect!
  13. I manage a fleet of workstations that are all configured to sync time with the NTP server 0.pool.ntp.org. While there are some Windows workstations in the mix, there are many Macs running OS X Mavericks 10.9.1, and for now I'd like to just focus on the Macs, since that's what my most vocal users are using. Even though I have everything set correctly in System Preferences, (i.e. the 'Set date and time automatically:' checkbox is set, etc.), the computers tend to drift over time. My own workstation was off by 2 minutes and 1 second today, for instance. I checked Activity Monitor and 'ntpd' was running with no apparent problems. BUT, the only way my time would update is if I take a trip to System Preferences > Date & Time. The moment I enter the Date & Time pref pane, the time updates. I suspect if I were to restart, it would also work, but I haven't tried that. We tend to just leave our computers on. I suspect this is a bug with OS X, but I'd like to take the matter into my own hands. Here's my scripting so far: #Check local time vs. server time Set Variable [ $time_difference; Value:Get(CurrentHostTimeStamp) - Get(CurrentTimeStamp) ] If [ Abs($time_difference) > Time(0; 1; 0) ] #Time difference is greater than 1 minute If [ $$current_workstation_platform = "Mac" ] #Attempt to update system clock via shell script Perform AppleScript [ Calculated AppleScript: "do shell script "ntpd -g"" ] Set Variable [ $time_difference_old; Value:$time_difference ] Set Variable [ $time_difference; Value:Get(CurrentHostTimeStamp) - Get(CurrentTimeStamp) ] If [ Abs($time_difference) ≤ Time(0; 0; 1) ] #Time is now within 1 second and is considered fixed // A notification is sent to me regarding the problem and the fix. End If End If End If If [ WS—workstations::i_TimeDifferenceLocalVsServer ≠ $time_difference ] #Time difference is different than recorded on workstation record - Update value Set Field [ WS—workstations::i_TimeDifferenceLocalVsServer; $time_difference ] If [ Abs(WS—workstations::i_TimeDifferenceLocalVsServer) > Time(0; 1; 0) ] #Time difference is greater than 1 minute - Notify admin // A notification is sent to me regarding the problem. End If End If The shell script "ntpd -g" apparently requires sudo access, and the point of this is to silently fix the computer's clock, so it is not reasonable to require this for my unauthorized users. How have others dealt with this issue?
  14. Yes, it is odd. In fact, I hope to be using a Windows server for FileMaker Server in the next couple of months. Screw OS X Server! Gosh it makes me sad to type that.
  15. I installed FileMaker Server 13 the other day and was annoyed when I got the prompt. I wasn't aware of this requirement, and it makes it all the more difficult because they want you to uninstall the old FileMaker Server before installing the new one (so I'd have to re-install the old FMS if I didn't like it). I ended up going ahead with the installation which disabled OS X Server's web service. I only had a few pages that weren't that important, but now I have to figure something else out. On the plus side, no more Java.
×
×
  • Create New...

Important Information

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