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

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

Recommended Posts

Posted

Hi,

Can anyone tell me how I can specify which layout to go when switching from one database to another? I have four main layout views that are duplicated in two different but related databases and I want to be able to specify which layout to go to when jumping back and forth between them. I'm new at this and haven't had any luck searching for an answer on my own.

Thanks

j

Posted

I don't know if this is the best way but it's one way of accomplishing the thing you want:

You culd have a global field in one of the databases.

The switch database script could look like this (from db1 to db2):(

Set field (db2::global; Get(currentlayoutname))

Open file (db2)

Run script (db2::Correct_Layout)

the script correct layout should look like this:

Go to layout (db2::global)

This works if you have the same names on the layouts, if they have the same number you could use the Get(currentlayoutnumber) insetad of Get(Currentlayoutname). If nothing is similiar you could write a calc

Go to layout (

case (db2::global="layout_xxx"; layout_qqq;

db2::global="layout_zzz"; layout_yyy;

db2::global="layout_ba3"; layout_efr)

)

If you have FM7 you should think about placing everything in the same database but in different tables. They you don't have to switch file. Then you only need the "Go to layout" step with a case calc and/or scriptparameter

It's one way ...

Posted

Hi j,

Update your profile (the link is "profile" below your name at the left) to reflect which platform, operating system and version of FileMaker you are using.

Lee

cool.gif

Posted

Thanks for post. I don't seem to be able to get the set field thing to work. I don't see a Get command to choose a layout (there is a Get Field), and if I type it in manually it doesn't recognize my layout name. I think I will just get the upgrade to 7.0.

j

Posted

I figured it out. Adding the Open DB action allowed me to then run the script to switch to the desired layout. Because initially I was switching from DB1 to DB2 using a go to related record command I wasn't using the Open command and was not aware that was required for the script to work properly.

Thanks for everyone's help!

j

Posted

The preferred method for scripting navigation between files is to have a script in the local file (attached to a button,) call a navigation script in the other file. The Open script step is not needed.

Local script "Go to Contacts":

Perform Script [ Sub Scripts, External: DB2 "Go to Contact List" ]

Nav script in DB2 "Go to Contact List":

Go to Layout [ Contact List ]

Posted

hi j,

I see others have helped you with your question. Now you can see why it was important for us to know the profile information. Things have changed from version to version, and the approach is sometimes different, if only in the way in which the Functions have been named, and the use of ";" instead of ",".

Whether or not you upgrade to v7 is a decision that you should base on several factors. I.e. is if your operating system and CPU able to handle it.

Lee wink.gif

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