Jump to content
Server Maintenance This Week. ×

Creating a script to find Items in stock


This topic is 3468 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

  • 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!

Link to comment
Share on other sites

Hmmmm, maybe this?:

Set Variable[ $item ; yourItemNameField ]
Enter Find mode
Set field[ Item name ; $item ]
Set field[ location ; "office" ]
Perform Find
Link to comment
Share on other sites

  • 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:

Link to comment
Share on other sites

This topic is 3468 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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