Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

  • Newbies
Posted

Just got up from the sword I fell on. New at FM.

Writing a DB to barcode scan issued firearms and equipment for a duty shift - both in and out.

Have a History table that records various things including the person issued to, time in and out and the equipment ID.

Also have an equipment table that records items, serial numbers etc.

The equipment table has a flag to record whether the item is in or out. My sign out script sets the flag to '1' by simply

set field [Equipment::is_out; 1]

I can't seem to manage to reset the flag to 0 upon equipment return.

I need the flag to be in the equipment table as I use it to provide a count of items in and out to enable a shift handover.

I guess the question is - when I change layouts to set a field - how can I navigate to the corresponding record to change the flag?

I'm sure this is a simple to all you FM guru's out there!

Posted

The History table has an equipmentID, right? Create a relationship from History to Equip by EquipID. Then your "return" script can set the equip flag thru the relationship, without switching layouts.

Set Field (history_Equip::is_out; "") //return

or

use GTRR History to Equip by EquipID and set the Equip field.

  • Newbies
Posted

bcooney - Wow - that worked. I think I had actually tried that previously but hadn't ticked the allow creation button. Many thanks.

With reference to the comment of using a calculation for the status - can you give me an example? - It is current a number field with a value range of 0 or 1

All the time spent trying to nut this out - wish I'd found this Forum earlier.

Posted

using a calculation for the status - can you give me an example?

Well, you could use =

Count ( History::Out ) > Count ( History::In )

for example. If this is for display only, you don't even need that - see attached.

LoanOut.zip

Posted

Allow Create does not need to be checked. However, comment's suggestion to calc the status is the ideal solution.

  • 3 weeks later...

This topic is 4881 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.