2 Replies Latest reply on Apr 16, 2012 12:12 PM by philmodjunk

    Finding and modifying unique records via FM script

    DamienW

      Title

      Finding and modifying unique records via FM script

      Post

      First let me say I'm not very familiar with filemaker, I only use it ever year or so.
      Im hoping someone can point me in the right direction.

      In a FM script how do I set fields of a unique records (not the current record)?

      Thanks, any help would be greatly appreciated.

        • 1. Re: Finding and modifying unique records via FM script
          DamienW
          Incase it is helpful here is the background to my problem 

          I have a database that manages inventory & populates a website, in one of the layouts I have a [1 Sold] button, when clicked it reduce the available stock number by 1 (no problem here).

          Im trying to add a feature where 1 record can represent a multiple items (a pack or group)
          when the user clicks [1 sold] I need to reduce the stock number for each item in the group.

          I have a field where the user enters the ID of each item in the group. When the [1 sold] button is clicked I loop though the ID's

          this is where I am stuck. For each ID I need to find its record, modify stock number and repeat the process

          thanks again
          • 2. Re: Finding and modifying unique records via FM script
            philmodjunk

            Some business log such "kits" as separate (do not inventory) items. In FileMaker you can set up a related table that lists the individual items (and their quantities) that make up such a "kit" entry. You may want to consider those ideas for a future upgrade to your design.

            To answer the specific question (which I would not have had a clue how to answer until you posted your follow up post...):

            I am also assuming that you have to modify records in a related table to update your inventory. Let me know if this is not the case.

            Go to Record/Request/Page [first]
            Loop
               Go To Related Record [Show only related records; From table: Inventory; Using layout: "Inventory" (Inventory)]
               #put steps here to update inventory.
               Go to Layout [original layout]
               Go to record/Request/Page [next; exit after last]
            End Loop