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

Simplify, simplify, simplify

Featured Replies

I have a script that uses a pasted keyword to "Find" all the records for each component of my database. Downstream, I need this same script to change to the one of several layouts that matches my pasted keyword/component. For example, I want to go from artifacts to documents. My script uses the pasted "documents" keyword to find all documents and now needs to switch from the artifact layout to the document layout. Is it possible to have a (single) script switch layouts based on the pasted keyword?

Thanks.

L.

Sure. You just need some way for FileMaker to figure out which layout you want to go to.

Here's a script that would do the job for two possibilities.

Paste [ Select, gClipboard ]

If [ gClipboard = "documents" ]

I'm a little confused as to what you mean by "pasted keyword". If this is a value pasted to a field, that value can be tested in a script and use to cause a layout change to a layout based upon the value in the field. If the you are asking if a script can automatically execute based upon a value entered into a field (without the user pressing a button) the answer is 1) not with FM alone and 2) yes using a FM plug-in. -bd

Wow, Chuck, you were posting while I was writing!

[This message has been edited by LiveOak (edited November 28, 2000).]

No, _you_ were posting while I was writing. smile.gif

BTW, LiveOak, I have used a technique that will execute a script based on the value entered in a field. It isn't perfect, using a Loop to continually see if the value of the field has changed, and exiting if it has. Sometimes there's a delay between the value changing and the script continuing, because I can't set a script to pause for less than 1 second, but if you really need it, it'll do the job.

Chuck

  • Author

Chuck and LiveOak,

Hi! Thanks for the speedy response.

I must confess that while you were laboring to respond to my question, I learned of a solution totally unlike your method. In case your interested the following summarizes the approach:

Central to this solution are two parts: 1) to access a layout via a pasted word, convert the word, that corresponds to a layout, to a layout number and 2) select the calculation field, "Calc" in this case, that utilizes the results of the Logical Function "Case" when script step "Go to Layout" and "Layout number given by field" are selected.

Case

(

Category="Artifact", 1,

Category="Document", 2,...

Default Result=0

)

A couple of comments - the calculation field, e.g., "Calc", does not have to be on any layer and FM notes that "Layout numbers correspond to the order of the layouts in the file."

This solution is allowing me to use only one short script with six button choices to access the corresponding data input layout, out of six available layouts. It is better than creating many scripts that have to be maintained.

Thanks again. I hope to work with you both again in the near future.

Cheers.

L.

I had thought of that, and almost mentioned it. It's a good solution, just make sure that you don't rearrange the layouts, otherwise your script could break.

Chuck

Be aware that the Recover command resets the layout order to the order in which they were created, so if at any time you need to recover the file you can be sure that the scripts will probably break.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.