4 Replies Latest reply on Oct 30, 2012 9:07 AM by pdegior

    Unrelated Table in Portal

    pdegior

      Title

      Unrelated Table in Portal

      Post

           I have a project quoting file where we prepare bids for customers.  I have a layout that links to my Projects table.  I have a portal on the layout that is linked to the ProjBOM table.  Products in our Parts table are added to the ProjBOM table.  All of this works well. 

           I am trying to add a "Favorites" portal or list where the user can mark products they use often and can select from.  I created a "Favorites" table with "ID" (auto-enter serial), "PartNum", and "User".  The "User" filed is calculated by Get ( AccountName ).

           So I simply want to display a list of favorite products for that specific user.  I know I need to somehow add a relationship here, but am confused as to where to start.

           Right now this is what my relationships look like

           Customers = Projects = BOM = Products

           I'm not sure where to put the Favorites.  I obviously need the relationship between Products and Favorites. Any help would be greatly appreciated.

            

            

        • 1. Re: Unrelated Table in Portal
          philmodjunk

               I take it that you have:

               Customers----<Projects----<ProjBOM>-----Parts(Products?)   (---< means "one to many")

               Am I correct that each user will have their own favorites list?

               If so, add these relationships:

               Projects----<FavoriteParts>------Parts 2

               Projects::cAccountName = FavoriteParts::AccountName
               FavoriteParts::PartID = Parts 2::PartID

               For more on this notation, see: Common Forum Relationship and Field Notations Explained

               Make cAccountName an unstored calculation field that returns text: Get ( AccountName ). Make FavoriteParts::AccountName a text field and enable "allow creation of records via this relationship" for parts Parts 2 should be a new occurrence of your Parts table.

               And you can set up this portal so that clicking a button in the portal row will add that item to the BOM table.

          • 2. Re: Unrelated Table in Portal
            pdegior

                 Phil,

                 Yes, each user account would have their own favorites list.

                 I will give this a try.  One question though....Won't this setup limit the favorites list to favorites that are related to a specific project?  If so, I would like the favorites to be both project and customer independent.

            • 3. Re: Unrelated Table in Portal
              philmodjunk

                   The relationship matches strictly by account name so the particular project record that is current has no effect on what related records are present. But make sure that cAccountName is an UNSTORED calculation field or this won't work.

              • 4. Re: Unrelated Table in Portal
                pdegior

                     Phil,

                     Thank you very much.  That works perfectly!