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.

Login Items In Batches

Featured Replies

So I have no idea how to write a script and I need to make one for my work so heres the idea maybe someone knows.

We have tapes that can either be checked in or out (theres a button to click for "check in" or "check out" then the "status" would be set to either Available or Not Available. Every tape has its own barcode on it and we can scan them into the search bar to find them, but then you have to click check in for each one. When you have 10 - 20 tapes to log in it makes it a little more time consuming.

I am trying to find a way so that when Im checking a bunch of tapes back in I can run a script and then scan each barcode and it will automatically be checked in, if it was never checked out then a message or error should show saying it was never checked out.

Any help would this would be greatly appreciated!

Thanks,

Zac

Hello Zac,

Couple of questions. Sounds as if you have a very simple loan system. What tables do you have? For instance, you have a table that stores info about the tapes. Perhaps it is called Equipment or Items?

Do you have a Loan and Loan Items table? Do you have a Return and Return Items table? How about tracking who borrowed what--do you have a People table?

-Barbara

  • Author

Thats exactly what it is, its used to keep track of what we have here and what has been sent out and where.

Its actually based off the starter solution for Asset Management. Ive only changed some of the names and fields. The tables im using are called History, Tapes(formerly assets from the starter solution, and Contacts.

Picture_1.png

  • Author

So i learned a little more about scripting today and maybe this will be a clearer way of explaining what im looking for.

I need a script that as soon as i scan a barcode it will check to see if the tape has been checked out or not. If it has been checked out it will automatically be checked back in.

If the tape has not been checked out it will bring it to the next layout like it does when you manually click check out.

I believe that you can script a multi-check in procedure, but you need to know who checked out, so you cannot script checking out in batches.

In a loan system I've worked on, we have a "Return Items" script (on the main menu). It pops a window with just the barcode field on it, enters find mode and pauses. The user scans the barcode and presses enter (performs the find) in the Loan Line Items table. All* open loan line items for that EquipID (BarCode) are Returned (Date_Returned entered). The script then returns to the BarCode layout in Find mode, ready for the next return.

Perhaps a routine such as this will help.

*The return might find more than one open loan line item. This'll happen if an item was loaned without first being returned. So, we cleanup our loan line items at each return.

Edited by Guest

  • Author

With the way the database is set up now it doesnt let you loan an item if its marked "Not Available".

Would it be possible for you to give an example of that script that you wrote? That way I could just change some of the names around and make it work on my database. I can't figure out which commands to set in order to make the script Ive never really scripted anything before.

Zac, I created a new file from FM's Asset Mgmt template. God help us from FM's templates! It's a single table solution. Why do they do this to people? This is entirely too simplistic for a true loan system. There is NO loan history possible.

OK, so you've added a History table which will serve as a Loan Line Items table. I'm confused as to why at the top of your screen shot you show "Tapes" and next to it is the word "Contacts". What table is this layout based on, "Assets?" Why then does it say "Contacts?"

I'll try to do up a simple Loan demo with a batch return process in the next couple of days. As I said above, you need People, Loans, Loan Items, and Equipment (Assets). You can get away not having Returns and Return Items tables.

Edited by Guest

  • Author

That would be awesome thank you so much! Its actually based off the lending library starter solution which has a history tab and i just changed what said assets to say tapes. I hope this clears things up.

Oh, Lending Library is much better starter solution. It has the three key tables we need: Contacts, Assets, and History.

I'll see if I can find some time to add a multi-check in routine, assuming that you're scanning a barcode.

  • Author

Thats awesome!! Thank you so much for all your help! it works perfectly :P

  • Author

So I tried so figure this out before asking for help again but I dont have much of a talent for scripting :P.

I think it should be possible to do a batch checkout as well as long as its all going to the same person. It would work the same way as the batch check in but before taking you to the check out screen it would show the contact list just like you were checking out 1 item.

Ive made a new layout for the check out items but what things in the script do i need to change in order to make this work? I tried figuring it out but it kept saying there were scripting errors when i did it.

Let me have a go at it. It would be a button onthe Contact page. Check back this weekend.

  • Author

thank you so much for all your help!!

  • Author

So the scripts you made work but when I change some names and fields it messes everything up. I tried not to change any of the fields used in the script and I did it twice to make sure I didn't. What am I doing to this database thats messing up the script?

VaultLog2.1.fp7.zip

Can you give me an example of what's not working? All I can see is that the Asset Name in History wasn't set to the correct field. It should be "Assets Asset ID::Series Title."

Btw, this isn't you. This is an example of a lousy starter solution. I used it to show you the technique of grabbing an ID in a global and the script to return and check out using a line item table.

  • Author

Well the batch check in and out both let me enter items more than once, resulting in extra entries on the history tab. I also tried using batch check in/out and normal check in/out on the same item and it got stuck on not available and wouldnt let me check it back in.

I dont understand it because on yours it works like it should, but when i changed those names it stopped working.

In the script, Batch Check In, change the step in Find block to:

Set Field [History::Check In Date; "=" ]

"I also tried using batch check in/out and normal check in/out on the same item and it got stuck on not available and wouldnt let me check it back in. "

I can't get this to happen. Can you tell me the exact order of steps you take to get the error?

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.