2 Replies Latest reply on Jun 19, 2009 10:42 AM by craig5005

    Need some help



      Need some help


      I am having a bit of a problem, and if someone could help, that would be great.


      Background: my database has equipment, and boxes that the equipment goes into.  Both have their own tables with box id in it (and these are connected through a relationship, that way we know which equipment is in which box).  

      We need to 'deploy' these boxes and equipment within the boxes on occasion.  When we do this, we bring up a list of all the boxes and have a button that sets the 'deploy' field in the box table to "yes" and also the "deploy" field in the equipment table to yes as well.  It works fine, except it will only ever set only one piece of equipment to "yes".  For example, if there is 10 items in box 1 and we deploy it, only the first item will be marked as "yes" in "deploy" field (and the box will be yes for deploy as well).  I tried "replace field contents" but this changed all equipment deploy status to yes in the found set, not just the one we wanted.


      Most people at this point will be thinking, connect the two "deploy" fields through a relationship.  However, we can't do this as when we return from deployment, some items might be missing.  So when we return, we have a sign in layout in which we can sign in boxes and individual pieces of equipment (set deploy field to "no"). 


      I hope someone can help.




        • 1. Re: Need some help

          You need to generate a found set of equipment records so that Replace Field Contents can update them to "Yes".


          Let's assume you have a layout in your file named "Equipment" for displaying records from the equipment table.


          From your "boxes" layout, run this script:


          If [count(Equipement::EquipmentID) > 0]

            Go To Related Record [Show Only Related Records; from table: "Equipment"; Using Layout: "Equipment (Equipment)"]

            Replace Field Contents

            Go To Layout [Original Layout]

          End IF


          This will mark all the contents of the current "box" record as deployed. THe If statment avoids a limitation of GTRR that keeps it from working if there are no matching records (If your Box is empty in this case.)

          • 2. Re: Need some help

            Thanks PhilmodJunk... you always provide excellent (and quick) solutions!