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.

variiables in find

Featured Replies

Is there a way to use a variable in find mode?

What do you wish to do with the variable, store the results or...??

--sd

  • Author

Use the variable to find a record.

I'm utterly puzzled here, a developer calling his/her skill level Advanced should be abel to think the following up:


Set Variable [ $what; Value:Invoices::CustID ] 

Enter Find Mode [  ] 

Set Field [ Invoices::CustID; $what ] 

Perform Find [  ] 

If this script is executed in a record will the found set after the run, be all the customers invoices. The result of over generalized is too often stabs in the dark, please descripe the context as well as purpose, next time asking!!!!

--sd

Edited by Guest
something daft in the scripting

Why the go to related step Soren? Seems it's not really needed unless I just need more coffee....lol

I'll change it now! :giggle:

--sd

  • Author

It doesnt work. Thats exactly the way I did it.

Changed it to a global field and it works.

Layoff the personal attacks!

How does it not work? What does it do? You could use Script Debugger since you have advanced so you can see what is happening.

Edit: I missed the comment about you changing it to a global. Did you change the field to a global or the Variable?

Michael

Edited by Guest

It doesnt work. Thats exactly the way I did it.

Changed it to a global field and it works.

The variables are case sensitive so $myVar isn't the same as $Myvar ... similar are $$var different from $var, where the former are global, and the later stops working when the script terminates.

Finally can't variables be transfered between files, for this use scriptparameters, and make them survive passing the boundaries by utilizing this technique:

http://www.fmforums.com/forum/showpost.php?post/187787/

--sd

Edited by Guest

  • Author

Changed it to field global and it works.

When it was a $variable I stepped it through and watched it in the the Data Viewer. It never showed up in the watch window; always showed up in the current window. This is what is causing me trouble. Very strange.

I'm sure Soren did not mean to attack you personally. He was, as I often do, trying to interpret what your goal was and why you were stumbling given the few details of the original post. If you are an advanced FM dev, finding with a variable is fairly routine, and so he dismissed that as the problem, given your rank. Soren's method works.

The variables are case sensitive so $myVar isn't the same as $Myvar

That's not my experience.

Ahh! Once again David! you are Fermat'ting me again!

http://www.fmforums.com/forum/showpost.php?post/277029/

I wonder why I've picked that up, have the DV changed behaviour when we upgraded to fm9 or...:)

So this leaves back the scope to which a variable can survive, the bounderies are script for a single $ and the file for a double ($$), going beyond that, is largely considered bad habit by people drilled with object oriented designs:

http://www.fmforums.com/forum/showtopic.php?tid/188219/fromsearch/1/hl/tokerud/tp/0/all/1/

At least something which needs to be approached with restraints, and repairing it with a genuine global field is IMHO even worse!

--sd

  • Author

Just figured it out!

Set Variable[$$Find[3]; Value:css::part number]

Go To Layout ["List" (css)]

Enter Find Mode[]

Set Field [css::part number: $$Find[3]]

Perform Find[]

Line 4 $$Find needed the [3]; you have to add this in in the Specify Calculation. Good old FM!

Thanks for all your help.

You have a global variable with repetitions? You don't need that. You can change it to a local variable and remove the repetition.

  • Author

Our part numbers have 3 repetitions; each part can have 3 different numbers.

Do I still need the repetitions?

Thanks for all your help.

I think that it was your skill to solve your problem, not the Forum's members

You have opened up a whole new can of worms.

It's generally bad practice to use repeating fields. Without knowing your whole structure it's tough to say how you should have it set up though.

In my experience I have found that repeating fields will only make you work more to achieve your goal. For example as soon as you decide you want to sort the repeating field you are stuck.

Michael

Do I still need the repetitions?

If the partnumber field is a repeating field, couldn't a single request distinguise each of the repeaters from the other, you're doing yourself a favour by having tree different fields, you can always modify 3 request, by the use of:

http://www.filemaker.com/help/Script-Steps36.html

See the technique here:

http://www.filemakermagazine.com/videos/faster-or-search-script.html

--sd

Your question is not clear. In general, a repeating FIELD is a single field as far as finding in it. So if you are searching for a value in any repetition of a repeating field, you can enter the value into any repetition in Find mode. I don't see what repetitions of a VARIABLE have to do with this.

Perhaps you should elaborate a bit more when posting a question and save us the need to guess.

  • Author

Thanks, you answered the question.

Barbara and I tried to say the same, apparently without much luck?

-sd

  • Author

Soren:

Sometime the light is slow to turn on! And I am sure you have times when your candle does'nt burn to bright. ;>)

I'd rather admit, it's usually...

--sd

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.