Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5646 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

My client wants a pair of "Save" and "Rollback" buttons on some layouts. I'd like to share with you the logic I'm considering, to see if I'm missing something and/or if there might be a more efficient way.

It's entirely possible in this networked solution that more than one user could be unwittingly editing the same record at the same time, so any system should provide for that contingency.

There are several portals on these layouts and the user could be editing more than one record within a portal.

The client wants a single pair of Save/Rollback buttons on the layout that requires a single click applying across the board to all the editing changes that might have happened.

One method I was considering was to pair each of the fields — FieldA (displayed) with FieldA.validate (hidden). Track whether any of these pairs have changed and therefore be able to make a Conditional Format change to the button pair to make it obvious these buttons must be used.

An alternative would be to use globals for display and keep the authentic fields hidden. This might help with the multi-user aspect. I would have to use repeating field globals and populate them appropriately for the multiple record portals. Which feels like an overly complex piece of coding to do.

So it might be better to block any second user to the same layout, same record. Not sure how to do that.

Before I invest a lot of energy down an unsuitable path I'm asking for feedback on the above. Appreciated.

Posted

It's entirely possible in this networked solution that more than one user could be unwittingly editing the same record at the same time

No, that is not possible - unless YOU have made it possible. I suggest you read very carefully what Ray says in this and the subsequent post:

http://fmforums.com/forum/showtopic.php?tid/181617/post/227421/#227421

Posted

No, that is not possible - unless YOU have made it possible. I suggest you read very carefully what Ray says in this and the subsequent post:

http://fmforums.com/forum/showtopic.php?tid/181617/post/227421/#227421

Now I'm really confused. The link provided goes into great detail about an "FDS Table Viewer". Does FDS (whatever it is) apply to the heart of my question?

Yes I have no intention of circumventing FMPs native record locking system. However I'm unclear as to whether record locking applies to the portals on the current screen as well. If so, then the clashing edit problem just goes away.

However you've made no comment on the balance of the logic, the real meat of the question.

Posted

However I'm unclear as to whether record locking applies to the portals on the current screen as well.

When user edits a portal record, Filemaker automatically locks both the current parent record and the child record being edited. For more details, see the “Record Ownership” article by Ilyse Kazar in FMI's "Migration Foundations and Methodologies" white paper.

Filemaker also provides a built-in mechanism for rolling back edits. You only need to set the layout to NOT 'Save record changes automatically', and provide buttons for "Save" (Commit Records/Requests) and "Rollback" (Revert Record/Request).

To avoid the annoying dialog whenever users clicks outside of any field, you can use an empty web viewer object as the background.

Does FDS (whatever it is) apply to the heart of my question?

That thread discusses a method where record data is loaded into global fields for editing.

Posted

A cool technique JMO described in his recent FM Advisor column is to attach a script trigger OnRecordCommit, that throws a dialog asking the user if they want to Save, Keeping Editing or Discard All Changes. Very nice.

Posted

It's not tricky. It's done using a OnRecordCommit layout script trigger. It's pretty straightforward.

What complications do you see?

Posted

Perhaps we are not speaking of the same thing. I don't really need a confirm dialog - I can get that directly from Filemaker, by leaving the 'Save record changes automatically' option unchecked. The trouble is that the dialog comes up too often. I want the record to stay uncommitted no matter what - until the 'Save' button is clicked.

Posted

I suppose JMO's solution is more elegant than the built-in FM method in that it lets you customize the dialog, and trap for nav away from record in a much easier fashion.

Posted

To avoid the annoying dialog whenever users clicks outside of any field, you can use an empty web viewer object as the background.

Doesn't work, not sure why. The layout contains a tab panel and within three of the tabs are sub tab panels. I've tried several options — same size as the form itself and placed at the very back of everything; sized slightly smaller than the main tab panel and placed as the bottom layer of that; and sized a touch smaller than the sub panels and placed immediately behind the actual edit fields (but above the background graphic). In all instances, FMP asks whether to save the record or not.

The web viewer itself has no URL location and the default options have been unchecked.

Any ideas why this isn't working for me?

Appreciated.

Posted

If you are using tab panels, you'll need a web viewer inside of each panel, in addition to the one covering the entire layout.

Now it works. Much thanks for your help.

This topic is 5646 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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