FM BetterForms
BF Editorfmbetterforms.com
1.0 dont use
1.0 dont use
  • Introduction
  • Features Summary
  • Getting Started
    • System Overview
    • Integration
      • 1. Configure FileMaker Server
      • 2. Add your Server to BetterForms
      • 3. Introduction to Hooks
      • 4. Create your first Site
      • 5. Create your first Page
      • 6. Configure your FileMaker File(s)
      • 7. Run your first Hook
      • Next Steps
    • Common Customizations
      • Introduction to Actions
      • Introduction to Buttons
      • Page Navigation
      • Displaying Data in a Table
    • Support
      • Hacking a Webpage
      • Learning JSON
  • Reference
    • Site Settings
      • Navigation
      • Slots / Code Injection
      • App Model
      • Site-wide Named Actions
    • Page Settings
      • Data Model
      • Card / Window Modals
      • Validation
        • Custom Validators
      • Misc Page Settings
    • Page Elements
      • Common
        • Button
        • Data Table
        • HTML
      • Grouping Elements
        • Tabs
        • panel
        • accordion
        • listrows
      • Uploading Files
        • dropzone
        • dropzone to S3
        • uploadCare
      • Misc Elements
        • Plain Text / Code Editor
        • signature
        • fullCalendar
        • rangeSlider
      • Payment Gateways
        • Authorize.net
        • PayPal
        • Stripe
      • Adding Custom Page Elements
    • Actions Processor
      • Named Actions
      • Actions
        • runUtilityHook
        • path
        • debounce
        • throttle
        • showAlert
        • showModal / hideModal
        • function
        • clipboard
        • cookie
        • setFocus
        • wait
        • emit
        • validate
        • channelJoinAnon
        • channelLeaveAnon
        • messageSend
        • messageSendAnonChannel
      • Authentication Actions
    • Script Hooks
      • Globals Variables
        • $$BF_Model
        • $$BF_App
        • $$BF_State
      • Keeping Keys Private
      • Reducing Payload Size
      • API Callback Endpoint
      • Common Hooks
      • Scoped Hooks
    • Users & Authentication
      • Managing User Accounts
      • Custom Login Pages
    • Advanced Configuration
      • Custom Domains
    • BF Utility Functions
    • BF Error Codes
    • Messaging
      • Adding users to channels
      • Removing users from channels
      • Sending messages
      • Get connected users
      • Get active channels
  • Usage Tips
    • Troubleshooting
      • Debugging
      • Frozen Actions Queue
    • JavaScript Tips
      • Calling Named Actions from HTML Vue Events
      • Calculations
    • System Overview
    • Forms Processor
      • Form Types
      • HTML & VueJS
      • Styling and Design
      • JS Caclulations and Functions
    • Customizing and Styling
      • Custom Components
      • Custom CSS
      • Custom Components
      • Page Pre-loaders
      • Favicon
    • Design Patterns and Best Practices
      • Working with environments
      • Handling Data
      • Saving Data
      • Optimization
      • Business Logic
      • UI / UX
  • Security
    • Authentication
    • Security White Paper
    • Firewalls
    • Technology Stack
  • Compatibility
Powered by GitBook
On this page
  • onUtility
  • onFieldValidationHook
  • Wizard Forms
  • Additional Submission options

Was this helpful?

  1. Reference
  2. Script Hooks

Scoped Hooks

Scoped hooks are specific to the page on which they are initiated and contain relevant data about the page context

PreviousCommon HooksNextUsers & Authentication

Last updated 3 years ago

Was this helpful?

onUtility

By far the most common type of scoped hook! This hook is called with the like so:

{
  "action": "runUtilityHook",
  "options": {
    "type": "save"
  }
}

In BetterForms you can differentiate buttons by passing a different value in the options.type key. Then, in FileMaker parse out the options object from the $$BF_Payload and branch the script accordingly.

JSONGetElement ( $$BF_Payload ; "data.hookPackage.options.type" )

onFieldValidationHook

This hook is called when a field has been assigned an fmsHook validator.

The .validation object is broken out for you in the var $validation You can make business logic decisions based on the data here. The rest of the other objects are also available including $actions so you can inject workflow changes too.

To pass back validation error messages set the validation.error element to your error message.

.validation Object
Type
Description

validation.value

string

The value of the single field that is requesting validation.

validation.field

{ object }

This is the formSchema field object, this can be used to identify what field is requesting validation.

validation.model

{ object }

This is the data model for the object(s) requesting validation. This is not needed currently but present for future use.

validation.error

{ string or array }

This is passed back to the server and the contents are displayed as error messages.

Wizard Forms

onTabChange

This hook is run if the Run onTabChange Script Hook is enabled for a wizard form.

onComplete

This is run when the user clicks the Complete button for a wizard form.

Additional Submission options

There are times you want to run actions prior to calling server side scripts. If an optional wizardOnComplete_actions key has bee set in the form ( misc tab) then those actions will be run in place of the onComplete script hook. You will have to call a utility hook within your actions for server side logic.

The following hooks only apply the pages of the "wizard" type. The are called on special cases, but otherwise function just like the hook type.

runUtilityHook action
onUtility