3 Replies Latest reply on Aug 1, 2012 8:51 AM by philmodjunk

    Relationships and portals.

    AlexRansome

      Title

      Relationships and portals.

      Post

      Hi,

       

      I have three store rooms and an engineer can use a cable from each store for a task. 

       

      The tasks are either A,B or C and they will come off the stock from rooms 1,2 or 3. 

       

      When the engineer uses the cable they press a button and a script adds one unit to the "units out" field of the inventory template, effectively removing one from the stores. This works fine if I have one store room. 

       

      But having three I though I could have 3 inventory tables and 3 stock transaction tables and 3 tabs showing the same layout with a portal and the button. 

       

      I have 3 separate scripts for each of the store rooms, but when the button is pressed for room 2 it adds one to the "units out" of it's store room (good) and one to the "units out" of room 1 (bad) I haven't put the button on the last tab.

       

      I thought it may be a relationship issue, so I removed the relationships. Now they are related via "ITEM ID Match Field" between the relevant Inventory table and the associated Stock Transaction table, but rooms 2 and 3 say <Unrelated Table>.

       

      Any ideas???

        • 1. Re: Relationships and portals.
          AlexRansome

          Update ...

          I have restored the original relationship between the Inventory table and the Stock Transactions, which seemed to be via the company name? So information is displayed on each tab which is different from the other tabs. But pressing the button to add one to the "units out" field still adds one to all 3 "units out" fields in the portals.

          The script I am using for the button on room 2's tab is...

          Go to Field [GIS Proj Stock Transactions::Units Out]

          Go to Portal Row [Last]

          Insert Calculated result [Select; GIS Proj Stock Transactions::Units Out + 1]

          Commit Records/Requests [No Dialog]

          And the script I am using for the button on room 1's tab is...

          Go to Field [GIS Stock Transactions::Units Out]

          Go to Portal Row [Last]

          Insert Calculated result [Select; GIS Stock Transactions::Units Out + 1]

          Commit Records/Requests [No Dialog]

           


          • 2. Re: Relationships and portals.
            AlexRansome

            Another update ...

            I have fixed part of the above problem ... The tables were duplicated and the name changed but there were references to the GIS table in the MIB table, calculations and stuff.

            Now I have this issue ...

            An error message comes up when I press the button "This operation cannot be performed because one or more required related records are not available and cannot be created."

            What does this mean?

            • 3. Re: Relationships and portals.
              philmodjunk

              I don't think setting up different tables for each room is a good idea to begin with.

              I'd use one table, but include a field with a value list for designating the room. You can tab a button or radio button to specify the room and you can also set this up so that the user taps a button to set a value for the room in a global field or variable so that all their inventory updates apply to the specified room until they select a different room.