Jump to content

Recommended Posts

bcooney    101

Perhaps I'm tired...but I would like a refresher on the subtle difference between these two triggers. In my use case, my script enters find mode, sets fields, and finds the target record (a scripted gtrr). Now that I found the record, I'd like to set all the default button bar $$active_segments, and perhaps nav to certain panels.

At first I tried OnLayoutEnter, but apparently that doesn't fire in Find mode. I could add all the setting of stuff to the script that does the find, but it occurs to me that perhaps OnRecordLoad is the better approach.


Share this post

Link to post
Share on other sites
Wim Decorte    446

if you change layouts while in find mode, the OnLayoutEnter will fire.  But it has to be enabled for Find mode of course.

If you want to trap the user switching modes on the same layout then the OnModeExit will do.

OnRecordLoad fires after the Layout change but if you only want to capture the layout or mode change then RecordLoad is overkill since it fires on all record changes.  Soliant has a big blog post with a triggers playground demo file that has all possible triggers enabled to make it easy to see the exact firings and sequences.

  • Like 2

Share this post

Link to post
Share on other sites
bcooney    101
8 minutes ago, Wim Decorte said:

 But it has to be enabled for Find mode of course.

OMG - Never noticed these checkboxes. Thank you, Wim. So embarrassed...

Share this post

Link to post
Share on other sites

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

  • Similar Content

    • By Scott Pon
      Environment: FM13 with FM13 Server, mix of Windows 7 and 10.
      Is there a way to set a script trigger on if this portal row is new? IE, a script to run if this new child/portal record is new.  
      We have a parent record, and portal to Children records.  The children records have 2 fields: Profile Name and Process type.  Our user would like to enter a new child record (profile name and process type).  if the process type already exists, we will need to archive the existing record (matching the profile type).  There is more bI want to start with this first.
      I see script triggers to the layout "OnRecordCommit", but no similar script trigger for portals.  Any ideas on how to handle this?  Or am I going to have to add a button to go to another screen to accomplish this?
      Thanks.  I hope i gave enough info for you to help me.
    • By dav1089
      I want to create a script trigger which opens a layout based on account name ,create new record and put cursor in first field of the new record
      Now, I was able to direct user to specific layout and also created new record using New Record/Request function but somehow it doesn't put cursor in the first field , instead it selects whole record .
      Note: I also have script triggers attached to first and second field which runs on exiting the fields. (I don't think they affect anyways , but just mentioned to give idea)
    • By dav1089
      I am gonna describe a scenario where total automation needed using only barcode scan, please bear with me:
      I am creating operator timesheet layout for product lifecycle in list-view.
      Each operator has a list of unique barcodes(printed sheet) for each production function.
      Every activity(function) of print production is assigned code (barcode) that represents function type as well as operator name: For eg. if John is working on new plates function for Press he'd scan barcode 301-1 but if Marc is working on the same function , he'd scan 301-2 , Now '301' represents new plates function and number after hyphen(-) represents operator. In John's case 1 and Marc 2.
      So, on the interface(list view of functions) , when an operator scans barcode of function it will set time-in field value and name of operator in their fields based on calculation from code.
      I don't want STOP button for each function to set value of time-out (because it requires user interaction), rather, I want it automated.
      I am looking for some sort of script trigger that runs on every new code scan and search for last record with similar operator name and set time-out value as current time in that record and set the same value as time-in for new function record. 
      Thank you
    • By CRexen
      Hello everyone
      I am currently working on a database, which HR-Managers can access via WebDirect using login-information, to accede or resign their employees.
      I have made 6 possible option types for the HR-employees to enter data into, set by an unique ID, but with the use of the same fields.
      X fields with option type 1 (Accede)
      Y fields with option type 2 (Resign)
      Z fields with option type 3 (Maternity leave / leave)
      .. Etc. 6 option types in total.
      Now, based on my project description, a couple of the fields will have to be validated / not empty, which the HR-manager is prompted to enter before the record can be committed.
      Now, I am aware of FileMaker has it's own Field Validation, but I think the built in feature is bonkers..... (Sorry FileMaker..) 
      Therefore I was thinking of making a script to each of the different fields, which needs validation, and is this even a good solution
      Question one; how do I do this, the most easily? Is it possible?
      I have 8 required fields for validation, fields are global.
      Fields such as; Company Name, HR-manager name, HR-manager e-mail, employee SSN, employee name, employee surname etc. 
      I don't want the scripts to interfere with the other option types ( X, Y, Z ) which each is set by an unique ID, as well as fields, although the fields used in these option types are from the same table.
      Please see attached images of my setup.
      Hope you can help me, for the best possible solution.
      If you need more information, let me know.
      P.S. The language/text on the layout is Danish, although shouldn't be considered an issue for understanding my problem.

    • By Alex117
      Hi, everyone. I need help creating a script to trigger when a Container field is modified, as in existing contents is replaced or deleted. I would like a custom dialog box to prompt the user if they really want to modify the Container field which has already been populated with content. If they select "OK", the changes are made, but if they select "Cancel", the changes are not made to the Container field.
      The reason this came up is because I want to prevents accidental delete or replace of a container field's contents via the "drag and drop" feature that FileMaker has. A user can easily hit the delete key while resting on the field or drop a new file onto it without considering the effects that the existing data will be gone forever. Since these container fields will hold important documents and information, I would like to add some pre-emptive warning measures on the user's side.
      I believe this can be done via the "OnObjectModify" script trigger on the actual container field, but I've had no luck testing scripts steps. Also, I discovered that if one drags and drops a file onto a container field, the field is automatically committed, so the changes becomes final instantly. So, using the "OnObjectEnter" and maybe other available triggers might not work exactly as expected in this scenario due to the default "drag and drop" functionality committing all changes instantly. 
      I also prefer to leave the "Save record changes automatically" option for the layout enabled. I know that leaving this unchecked will prompt you after exiting each field if any changes made should be saved, though even with this option uncheck the "drag and drop" behavior of container fields bypasses the default FileMaker warning message and allows you to overweight the existing content of the container field. I believe this is because the container field is never actually entered or exited, since a file is just dropped onto it to overwrite any existing one, and as mentioned above the changes are committed instantly. Now, if you actually do enter the container field, by selecting it, then the warning message triggers just fine.

Important Information

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