4 Replies Latest reply on Jan 7, 2013 2:25 AM by hanstrager

    a way to control amount of records in portal

    hanstrager

      Title

      a way to control amount of records in portal

      Post

           I have a portal where I want to control how many records the user i making - lets say a maximum of 7. I've allready set my portal to only show 7 records, and not put a scroll bar at the side, but this is only cosmetic. When i delete the portal rows, the extra records moves up upwards, but they should never have been allowed to be made in the first place...

           Is there a way to control this..?

        • 1. Re: a way to control amount of records in portal
          philmodjunk

               How can they make related records shown in the portal? Can they do it without using that one portal?

               What is the relationship?

               If the portal is the only means by which they can add a new related record, then limiting the number of portal rows is all that you need. If there are other ways that they can create that related record or link to an existing record, then you'll need to identify those means and build limitations into them.

          • 2. Re: a way to control amount of records in portal
            hanstrager

                 sorry

                 every portal record is added by a button and then can be deleted by another button.

                 I've sort of figured out that I probably have to put in some sort of "if" statement, or something into the script of my "add record" button, just not sure how to go about it. Have searched the internet and tried different solutions myself without any luck.

                 This is my script for my "add record" button and I've attached a picture of my relationship graph if that is ging to be of any help:

                 Set Variable [ $TechID; Value:TECHNICAL SHEET 2::xTechnical sheet_ID ]
                 Freeze Window
                 Go to Layout [ “Line Items” (Line Items) ]
                 New Record/Request
                 Set Field [ Line Items::TechSheetID_FK; $TechID ]
                 Go to Layout [ original layout ]
                 Go to Object [ Object Name: "fabrictab" ]
                  

            • 3. Re: a way to control amount of records in portal
              philmodjunk

                   Say you have a 5 row portal

                   If [ Count ( Line Items::TechSheetID_FK ) > 5 ]
                      Show Custom Dialog ["no more line items may be added."]
                   Else
                     Set Variable [ $TechID; Value:TECHNICAL SHEET 2::xTechnical sheet_ID ]
                     Freeze Window
                     Go to Layout [ “Line Items” (Line Items) ]
                     New Record/Request
                     Set Field [ Line Items::TechSheetID_FK; $TechID ]
                     Go to Layout [ original layout ]
                     Go to Object [ Object Name: "fabrictab" ]
                   End IF

              • 4. Re: a way to control amount of records in portal
                hanstrager

                     works like a dream, was the "count" i had forgot to put in in my own adventures to fix it my self... Thank you so much again...