5 Replies Latest reply on Mar 6, 2013 2:57 PM by philmodjunk

    Check out system



      Check out system



           I am creating a check out system.  I currently have three tables:
           Product, Product Details, Status

           Basically, a button is and a new record is created in status with the date, product and person checking it out.  To check in, there is a button to find the previous check out and mark a check in date.

           My trouble is in creating a list of products that are in/out.  How would I do this?  I have created a field called calcIsIn.  I do not know how to determine if the Product is in.  Is there a "last" function that could determine if last record has an empty check in date?

        • 1. Re: Check out system

               Yes there is and that function is called "Last". wink

               It allows you to check the value of a field in the last related record. But it cannot reference an empty field so you may need to modify how data in a field marks an item as "out".

          • 2. Re: Check out system

                 Awesome.  Thanks again Phil.  I made a new field (c_In) in status: if( isempty(checkindate), "Out", "In").  I then used calcIsIn in products to find last(c_In).  

                 There are several products that have no value due to not having been checked out.  I attempted to do:  If( IsEmpty(Count(Status::id)); "IN"; Last(Status::calcIsIn))
                 This does not give a value to the products that have no records though.  Any clue?

            • 3. Re: Check out system

                   Be sure to clear the "do not evaluate if all referenced fields are empty" check box that is found in the specify calculaton dialog.

              • 4. Re: Check out system

                     Thanks again for the quick reply.  I didn't even think about the "Do not evaluate..." option.  I changed this and it still does not provide the correct calculation.  I created a field that just has IsEmpty(Count(Status::id)) and it returns "0" for all records, including ones that have not been checked out and ones that have.

                     I then removed "isEmpty".  IsEmpty(Count(Status::id) is now Count(Status::Id).  It seems to work.  Is there any reason for this?  I do not know why "IsEmpty" was not functioning right.  I was following FileMaker help articles to get to this point.

                     EDIT:  Cancel that, it does not work without the "IsEmpty".  I used "Count(Status::id)" and it displayed "0's" and I thought it was fixed but adding the if statement back does not result in any value.

                     EDIT2:  I removed the count part.  The formula, in Products is now:  If(IsEmpty(Status::id); "IN"; Last(Status::calcIsIn)).  Seems to be working.  Is this wrong?

                • 5. Re: Check out system

                       Looks right, but I can't be 100% sure just from the limited understanding that I have of your database at this point.