Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Detect field modification before Commit

Featured Replies

Is there a function or some other technique to allow a script to detect whether there have been any modifications made to the data on a layout, before that data is committed?

I don't need to know what field(s) were changed, or how many changes there were. Just a boolean.

I have a basic Invoice/LineItems layout and I would like to alert the user ("Changes made - discard or save?") if he attempts to navigate elsewhere after modifying the invoice. Obviously I don't want to put up the alert when he hasn't made any changes.

Thanks,

Chap

Edited by Guest
add 2nd paragraph

  • Author

It's pretty close, the Get(RecordOpenState) function.

One problem: it doesn't distinguish between a New+Unused record (a new record into which nothing has yet been typed, let alone committed), and a New+TypedInto record (a new record into which something has been typed but which has not yet been committed).

In my interface, I require the user to always explicitly save or discard any changes she makes to a record. [This is because it gives her the heebie-jeebies not to perform some action to save/commit/check-back-in her work!] If she forgets to do this before, say, closing the edit window or clicking on the "Next record" button, I want to trigger an alert telling her that she has some "pending" changes, and does she wish to Save or Discard them? Get(RecordOpenState) does not appear to discriminate between a virginal and non-virginal New record.

It would also be very nice to be able to visually activate or deactivate the Save and Discard buttons conditionally upon whether there have been any saveable or discardable changes, but I'm not sure the interface can be made this dynamic without Script Triggers or something...

I hope that clarifies the problem I'm trying to solve.

Well, I would require the user to always explicitly save or discard any new record, too. Because the thought of countless empty records gives ME the heebie-jeebies.

  • Author

So how would you distinguish an empty new record from a non-empty new record, in order to avoid committing empty records? It didn't appear that Get(RecordOpenState) could help with that.

So how would you distinguish an empty new record from a non-empty new record

Here's a method to investigate, does at least some of it.

--sd

validationstages.zip

  • Author

Hi,

I looked at your file but I don't understand what I should be paying attention to...

Fields 1-5 are simple text fields. the_first_validation and the_second_validation appear to be important - both are validated by calculation; the first is valid if AT LEAST ONE of f1-f5 are non-null; the second is valid if ALL of f1-f5 are non-null. Additionally, the second allows override.

AH! I see - you're saying that, to detect whether a new record has pending input to commit, use hidden fields with custom validation, and validate with a calculation. The calculation does the work of examining the real fields to see that they're properly filled in. I'll try it. Hopefully, functions such as Count(field [;...]) return useful results even before the record is committed.

Yes - It seems like you're getting it!

--sd

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.