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

  • Newbies

Hi. 

I seem to find variating answers to this topic, so here I try again.

How do I use a variable to perform a find in a script? I want to use the field contents of the current record to search for similar records. 

Background: We send a lot of people out to different countries and I want to make a script that makes an excel sheet with various data based on the country field of the current record. Hence, if the current record is going to France, I want to see everybody that we currently have in France etc. However, we have two return dates so I need to do two searches: 

1. Country+ departure date <=// + arrival date >=//  

2. Country+ departure date <=// + Extended arrival date >=//  

Is it really true that perform find cannot handle a variable?

Hope you can help.

  • 3 weeks later...

comment,

 

Do I understand correctly that this is available in FM 15, but not in FM 14?  It looks like it to me based on the FM 14 help files....if so, arggh :(

Another question - when I try to use "set field"in find mode in a script, I get an error telling me my find criteria are not valid.

 

Enter Find Mode [ ]

Set Field [TargetTable::FieldToSearch; FieldWithSearchCriterion]

Perform Find [ ]

 

What am I doing wrong?

 

 

Is 'FieldWithSearchCriterion' a global? If not, it will have no value in Find Mode.

17 minutes ago, chemparrot said:

Do I understand correctly that this is available in FM 15, but not in FM 14?

If by "this" you mean the use of variables in scripted find requests, it's been available since version 11.

 

21 minutes ago, chemparrot said:

Enter Find Mode [ ]

Set Field [TargetTable::FieldToSearch; FieldWithSearchCriterion]

Perform Find [ ]

This can only work if FieldWithSearchCriterion is a global field (as Fitch posted while I was writing this). You probably want to do:

Set Variable [ $searchValue ; TargetTable::FieldWithSearchCriterion ]
Enter Find Mode [ ]
Set Field [TargetTable::FieldToSearch; $searchValue]
Perform Find [ ] 

 

Ah.  Thanks so much to both of you!

 

I wish the help files were better, I can see the help for FM 15 includes examples, but the help for FM 14 does not, which is why I thought it wasn't available. But passing it as a variable is a nice idea.

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.