Jump 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.

FM Jumps to another (random) record after script ends... huh?

Featured Replies

I am using FM 12 04 advanced.

I have a Membership application.  This script and problem revolves around two tables:

 

Members -->>DES

 

DES is represented by a portal on Members.

 

post-72145-0-19171600-1377741034_thumb.j

 

I have a fairly simple script (Just a bunch of If... Else if...).  It works well.

post-72145-0-09150000-1377741071_thumb.j

post-72145-0-55341900-1377741079_thumb.j

 

The problem is that after my script ends (I can watch it in debug), the record pointer jumps to another record (most of the time... but not always). 

 

I have added a Commit Record.  No help.  I have removed the Commit Record.  No help.  I have removed the Goto Object command and ... 'No help'....

 

Has anyone any idea why this happens?  Looks pretty straight forward and yet it happens... I am stuck and perplexed. 

 

Thanks for considering this.

 

Ron

  • Author

It seems like an Exit Script (0) prevents the problem.

 

Question: "Why?"
 

Is this subscript?  Is it trigger fired?  Exit Script [0] says to not proceed, same as false would.  So your script, as it is, is proceeding to the next field, next portal row, whatever.  Exit Script 0 stops it.

 

Regular behaviour AFAIK but it can be confusing.  So we would need to see whole script to know why it is acting like it is but it is wanting to proceed to a main script I think.  Showing part of a script never works, Ron.

  • Author

post-72145-0-78333400-1377756893_thumb.j

post-72145-0-18829300-1377756905_thumb.j

post-72145-0-56557800-1377756915_thumb.j

post-72145-0-66086400-1377756924_thumb.j

 

Ok.  Here is the script.  I think that most of it is irrelevant to the cause of the problem.  But, since I obviously don't get what is causing the problem, I must admit the reason 'could' be where I don't think it should be.

 

Thanks for your help.

 

Ron

how is this script triggered?

  • Author

RE: triggered.  On Exit from the date field.

on a field in the portal or on the parent?

 

The exit[0] basically cancels the exit so the cursor stays in the field.  Without it the focus would go to whatever is next in the tab order, which may be a field in the next record.  So check your tab order and disable anything that is not needed there.

  • Author

on a field in the portal or on the parent?

 

The exit[0] basically cancels the exit so the cursor stays in the field.  Without it the focus would go to whatever is next in the tab order, which may be a field in the next record.  So check your tab order and disable anything that is not needed there.

The script fires on Exit from a date field in the PORTAL.

But, the cursor jumps randomly (so it seems) to another record on the PARENT.

So far Exit(0) seems to cure the problem.  I just don't understand why FM is jumping at the end of the END IF at the end of the script.  It doesn't do that at the end of other scripts??? Perplexed... Ron

Here's the thing though: FM does not randomly jump to another record.  You're making it do it.  What you are getting caught up in is all the implicit behavior that FM does trying to anticipate what it is you are trying to do.  Clearly it does not anticipate correctly in this case but that's not really FM's fault but rather the result of you not taking explicit control of what should happen.  I realize this sounds harsher than it should but that is the crux of it and that is the learning curve that you need to get through.

 

Can't really help you with the issue at hand without having a copy of the file and being able to step through the scenarios with script debugger enabled and inspecting all the layout elements / tab orders etc.

  • Author

Here's the thing though: FM does not randomly jump to another record.  You're making it do it.  What you are getting caught up in is all the implicit behavior that FM does trying to anticipate what it is you are trying to do.  Clearly it does not anticipate correctly in this case but that's not really FM's fault but rather the result of you not taking explicit control of what should happen.  I realize this sounds harsher than it should but that is the crux of it and that is the learning curve that you need to get through.

 

Can't really help you with the issue at hand without having a copy of the file and being able to step through the scenarios with script debugger enabled and inspecting all the layout elements / tab orders etc.

Turns out a couple of things were going on: 

1)  I used the wrong object name to put the focus on the portal.

2)  I needed to 'get' the fact that setting the sort order in the portal only affects the 'appearance' of the data.  I needed to set the sort order at the relationship level.

 

You are right.  Everything FM does is 99% caused by something I coded or setup.  So, I am, with the help of people like you, slowly climbing the 'learning ladder'.  Thanks for your help and comments.

Create an account or sign in to comment

Important Information

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

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.