2 Replies Latest reply on May 17, 2010 10:12 AM by mps1773

    Script Triggers in Instant Web Publishing



      Script Triggers in Instant Web Publishing

      Your post

      Hi everyone,


      I previously posted this in the "Using FileMaker Pro" forum, and thought I would give this area a try as well (since it is a Server issue as opposed to a client issue):


      I am very new to FileMaker Pro.  I am using FileMaker Pro 11 on Windows Vista OS. 


      I have designed a tracking database with 4 layouts.  Of the 4 layouts, there are multiple Date fields which needed additional formatting for data-quality control.  I set up scripts "on object save" such that if the date was below 01/01/2010 or above 01/01/2020, show a dialog box stating that the date is not within a reasonable range, please check source; and then to clear the field.  You can see my script below:


      If[IsEmpty(Enrollment Tracking::Consent Date )]
       Halt Script
       If [ Enrollment Tracking::Consent Date<Date (1;1;2010) or Enrollment Tracking::Consent Date>Date (1;1;2020)]
        Show Custom Dialog["Date is out of range.  Please check source."]
        Clear[ Enrollment Tracking::Consent Date]
       End If
      End If


      This runs fine in FileMaker Pro client version, but unfortunately we will be doing data entry in Instant Web Publishing (which I was not aware of while designing the database.)  I know that custom dialog boxes are not supported under IWP, so that statement has been removed.  In researching how to get scripts to run, I found this statement:


      In Instant Web Publishing and Custom Web Publishing, script triggers can only be activated by a script and not by direct user interaction. For example, if a user tabs into a field that has an OnObjectEnter script trigger, the trigger will not activate. If a script step causes focus to move into that field, the script trigger will activate.
      I am not exactly sure how this works, i.e. how would I set up a script to activate the script triggers within my database?
      Also, is there any other way to display an error without using the custom dialog box?

      Thank you in advance for any help that can be provided!

        • 1. Re: Script Triggers in Instant Web Publishing

          " how would I set up a script to activate the script triggers within my database?"


          Generally this means you put a button on your layout that performs the script when clicked. This statement is a warning that if you click a button to trigger a script, the script's actions, (Go To Field can trigger a field's on ObjectEnter trigger--for example), may still cause a script trigger to fire even though you are interacting with the database via your web browser and Instant Web Publishing. Go To Layout and Go To Record are other script steps that can trigger a layout based script trigger such as on Layout load or On Record Load.

          • 2. Re: Script Triggers in Instant Web Publishing

            As for displaying an error message you can create a global field in your table for this.  This can be used as a generic message display system. Set aside a portion of the layout for a field appropriately sized to display any messages you may choose to feed it. Make it transparent to the background if you like, so that it is not visible and distracting during normal use.