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

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

Recommended Posts

Posted (edited)

If my goal is to write a script which will create a record in a table, and my goal is to also make this script as generic as possible (so it can be called from any layout/table), here is what I used to do:

(Assume FM8)


MakeARecordInTableX(id)

  Set Variable $id = Get(ScriptParameter)

  Freeze Window // to prevent flashing

  Go to layout (TableX)

  New record/request

  Set Field (key = $id)

  commit records

  go to layout (original layout)

end script

Now, this works great. this script can be called from anywhere in the solution, no matter what layout/record you are on, and it returns you to the same place you left off.

The problem is, that under FM8, if you started on a tab panel, when this script exits you might be left on the wrong tab.

One work-around is to start and end the script with "New Window" and "Close Window" steps. This seems to fix the tab panel problem, but even if you put in a "Freeze Window" step, you still get a big blank window flashing on screen.

I know I could do this using relationships and the SetField command, but that requires that you know what table you are looking at, which make the script be no longer generic.

Has anyone solved this problem?

Edited by Guest
formatting
Posted

To use a 'go to field' step, wouldn't you have to know ahead of time which tab you are on, so that when you exit the script you can choose the right tab?

Note: I claimed earlier that bracketing your script with "new window" / "close window" commands would prevent the tab panel from switching, but i appear to be wrong about that, at least in some preliminary testing.

This topic is 6866 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.