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.

Creating a script to find Items in stock

Featured Replies

  • Newbies

Hi

I am a complete novice at Filemaker. I work for an electrical installer and am creating an inventory system for the office to keep track of parts. I am basing this on a premade example I was given. What I am looking on doing is creating a script to search in multiple fields and return only those records. For example I wish to find all of the handsets of a particular type that are in the office. Since the stock system has a field which indicates where the part is (office, onsite, repairs) is there a find script I can use. I have attempted this myself but it just returns no records found and then doesn't return to an unsorted view of the layout. 

 

It would also be great if there was some way I could have a counter of how many of these items I have in stock that automatically updates when I view the record or make a change to the location of one of the items.

Are you able to make the Find work when you do it manually?

  • Author
  • Newbies

Yes What I want the script to do is basically return all records that have both the same Item name and location as office. I can do it easily using the search function but I eventually want to have a box showing current number in stock that is automatically updated.

can you post a printout of your script?

The Search Function is not the same as the Find Function. Are you using the key combo of control+shift+F? or Control F?

When people say "Search" in this context, I generally assume that we're talking about Find.

 

(There's no "Search" function in FileMaker -- control+shift+F isn't Search, it's Find/Replace.)

A basic Find script might look something like this:

Enter Find mode
Set field[ Item name ; "office" ]
Set field[ location ; "office" ]
Perform Find

But I suspect there may be more to this question. It sounds like you're asking about two separate issues. I'd suggest we deal with one thing at a time. Not sure if it's a scripting issue, but as Wim suggested, it's always useful to see the actual script.

return all records that have both the same Item name and location as office.

That's not a clear description.

 

I eventually want to have a box showing current number in stock that is automatically updated.

You can use a summary field to count the records in the current found set (count a field that cannot be empty, such as ProductID).

When people say "Search" in this context, I generally assume that we're talking about Find.

 

 

Maybe, but we are not positive, so why not get it clarified?

 

 

(There's no "Search" function in FileMaker -- control+shift+F isn't Search, it's Find/Replace.)

What a nice reply. 

Lee, it sounded like you were saying that a Search function exists, whose keyboard shortcut is control-shift-F. Sorry if I misinterpreted that, but it seemed worth clarifying for the benefit of the OP or other future readers.
 

The Search Function is not the same as the Find Function. Are you using the key combo of control+shift+F? or Control F?

  • Author
  • Newbies

I am sorry if I am being a little unclear. 

I have  a basic inventory system set up with a separate record for each item. The items are named and then there is a drop down which shows the location. I would like to create a script that when a button is pressed searches for all items of the same name in the location 'Office'. I would also like to create a box on the record which shows the current number of items with the same name in stock.

I can do this by searching the items myself but ideally it would be automated. Thanks for all your help!

I can do this by searching the items myself but ideally it would be automated.

 

Since it appears we are unable to follow your description, why don't you explain exactly (step-by-step) how you do this manually.

Hmmmm, maybe this?:

Set Variable[ $item ; yourItemNameField ]
Enter Find mode
Set field[ Item name ; $item ]
Set field[ location ; "office" ]
Perform Find
  • Author
  • Newbies

 

Hmmmm, maybe this?:

Set Variable[ $item ; yourItemNameField ]
Enter Find mode
Set field[ Item name ; $item ]
Set field[ location ; "office" ]
Perform Find

This worked great for the button to find the ones in stock! Thank you so much. I am a complete novice at this so I am sorry that I am not being clear.   :worship:

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.