5 Replies Latest reply on Dec 28, 2011 8:39 AM by philmodjunk

    Portal - display records +1

    Fagreement

      Title

      Portal - display records +1

      Post

      simple question:

      I have a portal, maped to a table Document, this portal in a layout which is mapped to table Document. there's a relationship between document and collection. when i see the data in the table document i find only one record that correpond to the related record Colelction:

      So Why in ;y portal it display 2 records instead of one ?

        • 1. Re: Portal - display records +1
          philmodjunk

          Can you describe that in more detail?

          I think you have  table nammed collection linked to a table named document. Your layout refers to Collection and your portal refers to Document?

          and how is the relationship defined?

          Is it this?

          Collection-----<Document

          Collection::CollectionID = Document::CollectionID

          Where Collection::CollectionID is an auto-entered serial number?

          Exactly what do you see in the portal?

          2 completely different records?

          The same record listed twice?

          One record and one "blank" record?

          • 2. Re: Portal - display records +1
            Fagreement

            yes, as you said:

            table nammed collection linked to a table named document. the layout refers to Collection and your portal refers to Document.

            relationship: Collection::collectionID = Document::collectionID (document side allow creation and deletion)

            Collection::CollectionID is an auto-entered serial number

             

            exactly i see the first record is true, well displayed, the second is blank

            • 3. Re: Portal - display records +1
              philmodjunk

              This is normal and expected. That 'extra' row is the "add row" that appears when "allow creation" is enabled in the relationship. It's purpose is to show you where to input data to create a new related Document record. If you do not want this added blank row, you can disable the "Allow creation" option for the relationship, but then you will no longer be able to add new related records just be entering data in this bottom blank row--that is no longer present. You'd have to add a button with a script to create new portal records for you.

              • 4. Re: Portal - display records +1
                Fagreement

                ok I see

                but in this case (if i remove the options in the releationship) can I create new doc related to a collection in the other layouts ?

                • 5. Re: Portal - display records +1
                  philmodjunk

                  Yes, but you'd need to perform a script that creates the new document record. In cases where you have a lot of records in your portal this is often a better option as you don't have to keep scrolling the portal to the last row in order to add a new portal record. You can even specify a sort for the record so that the new portal record sorts to the top. That way, you can click a button for a new document record and a new blank row appears at the top of your portal instead of the bottom.

                  Here's a script for creating a new portal record:

                  Freeze Window
                  Set Variable [$CollectionID ; value ; Collections::CollectionID ]
                  Go to Layout [Documents]
                  New Record/Request
                  Set Field [Documents::CollectionID ; $CollectionID ]
                  Go to Layout [original layout]

                  If you have a serial number field defined in Documents and specify a sort order for the portal that sorts the records by this serial number field in descending order, you will see a new blank row appear in your portal each time you perform this script.