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.

Featured Replies

Hi,

Great forum!

I have a question I hope someone can answer. I have a layout with a TCO with four panes, each pane representing one of four categories. I have four "new record" buttons, one for each category - and a script that shows the relevant pane accordingly. What I would like is to have FM automatically switch to the relevant panes while browsing records. Is this possible?

Oyvind Odegard

Oyvind:

If you use Go To Field[] and specify a field in the relevant pane, it will switch to that pane.

-Stanley

  • Author

Thank you Stanley,

that is a good tip, but how to trigger it for each record? For instance while scrolling in browse mode or within a found set? I'll hide the status area and do my own scripts for navigating, but I'd like to keep the scrolling ability if possible.

-Oyvind

You will need to use an event plugin. Take a look at Ray's demo for hilighting the active row in list view and see if you can pick it apart. The concept behind its technique will almost be the same. In your case, the triggered script should have it go the the proper tab using Go to Object.

http://www.nightwing.com.au/FileMaker/demos8/demo806.html

  • Author

Thank you very much!

I'll go trough it thoroughly, but at first look it seems to be what I need. I was hoping to avoid installing plug-ins on all clients, but I guess there is no way around it.

Cheers

Oyvind

  • Author

Works like a charm!

Thanks again,

Oyvind

  • 1 month later...
  • Author

Hi,

I guess my last exclamation was a bit premature. I use the zippscript plug-in as you recomended, and control the tabs with to fields. The field "Kategori" is set by a "new record"-script to 1,2 3 or 4 - depending on what kind of record is chosen. The other field "Kat_num" is a calculation field with the following calculation:

Let ($Num = Kategori;

Case (

$Num=1; zippScript_PerformScript( Get(FileName); "Tabscript1");

$Num=2; zippScript_PerformScript( Get(FileName); "Tabscript2");

$Num=3; zippScript_PerformScript( Get(FileName); "Tabscript3");

$Num=4; zippScript_PerformScript( Get(FileName); "Tabscript4")))

The tabscripts are simple "go to object" scripts.

This solution does what it is intended to do, and I always get the correct tab when navigating between records or layouts.

The problem is that the "Kat_num" field is recalculated on a seemingly whimsical basis, and very often two,three or four consecutive times (monitored as four instances of "tabscript2" as active scripts in the script debugger). This causes the screen to "flicker" as the layout is re-rendered, and even more irritating causes the cursor to jump out of its active field and go to the first field in the tab order. This happens when changing layouts, tabbing between fields or deleting a record - but not always.

The "Kat_num" field is set not to store and recalculate when needed. Seemingly for some reason Filemaker finds it necessary to recalculate when it shouldn't need to.

Anybody know what triggers the need to recalculate? Any tips or ideas on how to fix this problem would be much appreciated!

Oyvind

"Seemingly for some reason Filemaker finds it necessary to recalculate when it shouldn't need to."

This is often a side-effect of event-triggered scripts: there can be unexpected cascade effects. What does the Tabscript2 script do?

  • Author

tabscript2:

Go to object [objectname: "tab2"]

You are right. If I disable all other calculated fields in the table it works just fine. Any way around it you think?

Oyvind

Don't use zipscript. Just put script step 'Go to Object (...)' in your navigation script.

  • Author

That won't work if you scroll through records, or if you perform a find will it?

Couldn't you upload an image of your layout, might it be you're barking up the wrong tree??

--sd

  • Author

There are four tab-panes, the picture shows three of them. I've outlined the tabs with red - they are not visible in the original layout. The DB is an archaeological catalogue btw :)

Layout_upload.jpg

That won't work if you scroll through records, or if you perform a find will it?

You can script those actions as well.

I agree with Henk here:

http://www.fmforums.com/forum/showtopic.php?tid/189610/post/264591/hl//fromsearch/1/#264591

...and more specificly it's linkings to this template:

http://fmforums.com/forum/attachment.php?attid/8775/

--sd

  • Author

I've been searching the forum now for info on scripting and scrolling records. Could you please point me in the right direction? If it is possible to scroll through records and have the tabs change for each record without using a plug-in it would be great!

Thank you for taking time to help me out on this!

The script would be something like this:

Go to record/request/page [next] //or previous or first, or specified nr, whatever

Go to object [Object name: "TabNumber" & Database::CatNr]

Supposing that 'CatNr' is the field in the file 'Database' where category nrs 1-4 are stored and that your tab objects are named 'TabNumber1', TabNumber2', etc.

You can do more things in this script, like skipping records where the user has no permissions, or keeping track what the user does.

  • Author

Ah, I see now that I wrote earlier that I would disable status area and navigate by scripts. As it turns out I need to be able to scroll records using the mouse wheel, hence the need for zippscript to change tabs by calculation. I don't think it is possible to trigger scripts with the mouse wheel (is it?). When I said scrolling earlier, I really ment mouse wheel scrolling. Apologize not being more precise.

I still need some advice on the triggerfield recalculating and causing the "go to tab" script stacking up. Appreciate all help so far!

When you lock the status area, record scrolling will not be possible with the mouse wheel.

Record scrolling by mousewheel is not an 'intuitive' computer experience. Don't make it possible.

  • Author

I know, but this DB is supposed to replace an existing DB where mouse wheel scrolling is enabled. And the end users specifically asked for it. But I think I have solved the problem now, using the FrontTab function http://www.briandunning.com/cf/692

as a control for whether to run the tabscripts or not:

Let ($Num = Kategori;

If( $Num = Left(FrontTab;4);

"";

Case (

$Num="Tab1"; zippScript_PerformScript( Get(FileName); "Tabscript1");

$Num="Tab2"; zippScript_PerformScript( Get(FileName); "Tabscript2");

$Num="Tab3"; zippScript_PerformScript( Get(FileName); "Tabscript3");

$Num="Tab4"; zippScript_PerformScript( Get(FileName); "Tabscript4"))))

And this seems to work just fine. Now I'll just wait for the next pit fall, and call for help again :bang:

Thanks again!

Oyvind

Evaluate("zippScript_PerformScript( Get(FileName); "Tabscript"  & Int($Num) & "")")




could replace this:




Case ( 

$Num="Tab1"; zippScript_PerformScript( Get(FileName); "Tabscript1"); 

$Num="Tab2"; zippScript_PerformScript( Get(FileName); "Tabscript2");

$Num="Tab3"; zippScript_PerformScript( Get(FileName); "Tabscript3");

$Num="Tab4"; zippScript_PerformScript( Get(FileName); "Tabscript4")

I've made you a tiny file using this!

--sd

Oyvind.zip

  • Author

Thank you, I will certainly use it!

My scripts tend to be long and not very sexy :)

Oyvind

It's just a matter of choosing the right street, to optain street-credit ... there will most certainly be someone in you near family willing to drop their jaw(s) when you show them your massive Case(

--sd

There is something in this direction, to inspire you further:

http://www.briandunning.com/cf/747

--sd

sorry for advertising, but I love using LayoutProperties ( http://www.bh-a.com/downloads_1.1.html#DL01 ) to do that, because it makes it easy and secure.

The demo file shows how a layout can display two different tabs depending on data (the "Resize to fit" layout changes its behavior if the question mark is on).

I use this technique to lock an invoice for example.

But as Søren mentions, it would be a shame not to explore the CustomList() function.

Edited by Guest

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.